Implemented Solution 1