You use the constant 1 in a couple of places, would be cleaner if you declared it as an actual constant