optimising problem 7 more