added logw0 function and implemented it