Add Marking completed function and associated tests