compiles and links, but broken beyond all belief