fix call convention and add some todos