example code of preallocated checkin