only compute values once