functions for managind demand