Implemented logging functionality (not working yet)