Fixed #1 issue by adding some extra if statements around the randomly generated number