Final, working version.