added to machine, functions and fixed transactions
fixed up machine for merge
merged