Begin cleaning up code
Edit array accessing
Minor changes