Updated the addView function so that it can take an index to insert at specific locations in the view array.