currently works, but the even/odd arrays are global, which means it can't work recursively