used constants instead of magic numbers