Implemented 3D fit