Implement functional expireDeadlines, add comments, fix typos