This is the latest version of master  that does the wole thing.