Solution 6: correct mistakes