Semi-final draft. One final check of code and style planned tomorrow.