make signing transactions more efficient. add test