added missing return statement to sort method