Coded the transaction functionality - still needs to be tested