updated sample with new getValue(index) syntax