Added comments and fixed multiple operation button presses