FIx #324

Merged the original update function with the new one :)