working version transformation kernel