Three essays on the demand system