Implemented hashSort