Added checkpoint routine