stuck the compass away from the rest of the electronics, didn't seem to make much difference, threw a delay in the loop and suddenly started to get better readings. was previously attempting to read the compass as fast as the loop allowed, about 3ms.
also found that I needed to stick an abs() in...