added all sphdem stuff and compiles. now to debug