best version so far. still has 72 bytes lost (suspect there may be duplicate freeing going on from surpressed errors in the valgrind -v call). supressed error issues