added filtering for keys with a 2d index