changed some variables to constants and got rid of some magic numbers