implemented solution 3_5