fixing bug in term type checking, adding interface and function to show type