change to array based