fixed some logic errors.  was accidentally adding instead of pushing.  forgot to check divide by 0
moar comments