Working 3D implementation