porting code. more compiling