isAfter function (closes #5)