add comments and check end-of-execution