removed a couple of magic numbers to make things clearer