simplify:- map rather than bool array