added some type inferences