documentation and more memory fixes (coredump pls no more)