added sort algo problem and more refactoring