Finally a working version.