start porting to swift