added due date algorithm for index page