Rewrite incorporating all comments from 25/2/2013. Test begun but not complete.