Made dimensions and scaling more dynamic, got rid of some magic numbers