initial version with basic loop/start/stop support