Added some logging to files. Ultimately I should add my own pointer manager.