adding code for initially checking and marking up tasks and then changing state