remove all magic numbers

should all be gone besides 0's and 1's (and some 2's)