extended solution 9