updated sorting