added a basic logging system to assist in bugfixing