updated the rust code