everything working for the array version now