working version checkpoint 2