Added proper sorting and also addes hours remaining proper treatment