3d implementation

added 3d