computing once rather than twice