moved proces_loop into function, issue #34
Merge pull request #37 from philstark/issue_34

moved proces_loop into function, issue #34