implemented a basic subtyping system