without arraywrite that's a lot of code