formatting
declaration of commit method
implemented commit method