improved getValuesArray()