Cleaned up code; added acceleration and temperature processing