add standard loop func