I think your function of canonical variables is similar but better to mine.