changed return type to always include operation and key