Fix bug with pointer to memory allocation

remove testing stuff from example main