finish a simple calculator according to tutorial