Updated update function

Because complicated isn't always better.