added skeleton code for sort each transaction