Cleaned some more code up, too. Using constants instead of magic numbers in some places where it makes sense to use them.