finish porting to gi