Problems 5 and 7 solved