added handling of formal types