Wrote serial transaction code