invert updates. needs testing.