2d arrays and other bugs