removing recursive function call and replacing with a loop
Merge pull request #4 from amngibson/branches/removing-recursive-function-call

removing recursive function call and replacing with a loop