using boolean array