Removed some magic numbers

I removed some magic numbers; code is now slightly more adaptable and explicit.