added functions for semantics check