stupid mistake with arithmetic