new transaction logic

http://www.topcoder.com/tc?module=ProjectDetail&pj=30047369
Signed-off-by: elkhawajah <elkhawaja@gmail.com>