Implement calulator function. Passing all tests.