modified array unique to optimize performance