First nearly working version of log