non-static overhall part 1
added a bunch of comments
Made it work with locally allocated FILE pointers