modifying solution 1