added sanity checks
added more files to Xcode project
return codes
error checking