Task from 2.4.14 and ex10 from Loops chapter