working on generated quantities