Fudged a working version