include decomposition information into output file
minor cleanups
fix memory violations when used with Ap