HW 3 - task 3. Stable working version.