Finished implementation of type checker