add rudimentary type-checking