Björns accelerometer code