Removed magic numbers and replaced with variables