Update commit()
Merge pull request #26 from wcandillon/refactoring

Update commit() function