Adding functions and second class types to subtyping rules