more porting
most functions ported
ported skeleton of update function