add: toReg/toDir functions has been added.