fix calculation array size