defining an operation on objects