got code to do math right