Replacing with 2d library and 3d library