add some sorting algorithms and refactored