WIP: updated with Log calls and cleaned up stuff...