we could pass in a state and parameter dictionary as two arguments. that may be cleaner.