more code ported