added equals method for objects