Update calc.pl

clean up code