Add $type and $mod

TODO: change $type to number, add all types