separated main loop from decision loop; messed around with constants