Implement basic loop functionality.