added arrays, major redesign