Clearing tmp dir (with wbyoung).
Code cleanup (with wbyoung).
documentation of methods