Implemented basic loop