Updated calc() method