Added loop feature.