added calibration code and code that implements simple bot behavior