Added objective-c version