kata 18. simple loops tested ok