Finished the first problem in chapter3