implemented set-value-at function