cleaned up code, iterating through vectors using loop recur... still work in progress...