added historical data logging, WIP