add validity checking and dependency graph construction