fixed some bad arithmetic