added 3D functionality