added sort_array function to LCP