calculations work with 1d array