Issue #30 v2

On the basis of code from ```Issue_#57``` I've made the second version of solution issue number 30. Now we can choose whose solution.