finished problem 6, well, googled for some hints