only picking up first value of array, not second. need to find way to substitute that value into calculation function.