Reduced redundancy, improved output

Improved recurse parameter, generalized script, saved output to custom
object