finished part of the (now) old and not working logging system