improved the sorting algorithm a bit , tryed to improve the readability, added some test cases for packages with asymmetric variants