Add sorting package and move classes