freeing the stuff I allocate
added line number support

also removed extraneous prints and added more free'ing of things