fixed solution 2