added calculator function