fixed boundaries on loop causing odd shuffling behaviour