Big fixes in problem 8