Continued the porting to Swift