Added handling of printing and clearing variables in Calculator.