Change to how derived values are updated

Should be more efficient, to write them all for one entry at a time
instead of repeated writes once for each element, for each entry.
Merge pull request #9 from jegelstaff/derived-value-writing-optimization

Change to how derived values are updated