Solution 3: correct mistakes