Made array rotations reproducable and added commenting.