added objecive-c implementation