Fix bugs and translate from C code to Objective-C