got rid of some magic numbers