This is the offending line with the bug. The other changes are just trying to use constants rather than bare numbers