add clean function, add 3D visualization