adding 3d graph code