replaced malloc with foundation classes. some adjustments for the unit tests were necessary due to restructuring of test data on Amazon server