a prgram to sort an array