implementation for objective-c