Added commit method, fixes #9