complete version 1 with If Else and While Loops; not ideal Ruby Version