pull logic into recursable function
first pass at dealing with sub lists
test was wrong not code :)