updated typechecker

added check for converting variables to arrays