update loop function
Merge pull request #19 from yonderHub/loop-inteface

update loop function