moved three programs into chap1