Changed to use of the constants, rather than magic numbers