Add Xcode Project.
Make sure to correctly clear memory on initialisation, properly access array.
Correct off by one error in nSample.