porting to swift #2