sorting and problem solving