typechecker done + some tests