cache variables in updatePositions function