added some code to ch3