add function for instantaneous demand