refactor recursive function
Merge branch 'master' of https://github.com/willowtreeapps/branches