Removed unneeded variable.
Improved modulo bounds variable names.
Replaced magic num with an initialized variable.