Modified tex files

Modified thesis to have chapters for gluecode  and optimisations.
Added subsections to all chapters.