Anna: added documentation, cleaned up outputfn, MISSING licence