added all changes up to CHapter 5 end