building up the final transaction