algorithm 3D added and all classes modified -now compiling, but needs checking-