bootstrapped with s-rec and arity fixes