memory allocation in boost, tested with valgrind. new output format