Implemented transaction timeouts and added comments.