compute helper variables