Please, check comments inline

Hi Mykola,
I've found some issues with your code.
You could fix them, if you want to learn as much as possible from this task.