functionality for calculator implemented