Updated thesis to semi final version. pdf is ahead of tex file.