added a recursive fn to write s-expressions back to string format

not sure if it's typical for master to PR to fork, but thought you might want to look at the additions :)
I ended up with a recursive function for writing the sexp back out