Added markLast procedure.