Add support for update
Fixes for update
Merge pull request #1 from shaddi/master

Add update function