HMC5883L compass huge error [SOLVED]

Good points to both of you. I didn't like the way the code looked so I fixed it anyway. I don't see how that can possibly be related to my problem. Funny, it seemed to help a little! I'd like to point out that it is probably a hardware issue. I have used other example code without modification and it still cannot find North and South correctly. How can I fix this problem? Lookup table? The number are consistently wrong. When I draw lines on a paper and put it back to those lines, it always reads exactly the same number of degrees when it's kept level. But off by 20-90 degrees from the orientation of my house. I've moved it 2 feet from my laptop to avoid interference. It seems consistent no matter where I place the unit before I rotate it. Any more ideas?