got code to work for calculations