Implemented looping.