first version of log ... needs some work