Change int array to boolean array to reduce space use.