lots of garbage is created here try to generate less arrays to check the length