fixed IndexOutOfBoundsException
added lesson 6 about loops