Switched to using a logger. Added some doc