Added a better logging system.