Implemented transaction, bossiness logic and exception handling.