Added flags to make XCode use c++11.  Fixed array index bug.