better checking for equal objects and performance tests added