finish equals function