Task 11. Done.
Fix some logical problems.