First more or less working transformation

Type deduction is needed now.