Added repeat control, some changes.