rewrote dt -> AST conversion
added null check
fixed typing