added some JavaDoc, and made sure that external objects were finalized.