Algorithim works for character headers, no memory leaks. Wrote Makefile for one test case