added code to read compass (not 100% yet)