Thanks for your help goose!! I solved the problem. The whole time I thought I should be reading in and writing out unsigned short, when it is supposed to be signed short. Ughhh. What a brain fart. At least the problem is solved though.