replaced magic numbers with constants