array-based calculations