modified shift_operation.rb