switched to array representation