code complete, probably broken in some horrifying way