Update update() method.
Merge pull request #4 from cefarix/master

From Moutaz