Fix user_repeat loop and modify formatting