solution 1 updated