updated code to compile under Xcode 6.1