Add preliminary type support. Not working yet