btw this is probably a part we can speed up and reduce gc by not creating two arrays ...