add sort from Nabil and update application to take account