chapter 4 exercise

half way done. bug fixed. static image, not done