Changing sort achitecture and adding some bugs...