Switched rerolling to use while loop, minor cosmetic changes