chapter3 is done, but not tested yet