add Cast and Isof functions