Implemented logic for logging transactions, new class Transaction introduced.