added comparers. code refactoring.