solution for Calculator challenge