Adding log sensor update and fixing great many bugs