fixed whitespacing
extracted magic numbers