fixing silly compiler error and magic numbers