diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 9244e5780e9fe85229087bfb906c25aa6457636b..5e0057ced14719018cc4865993ac8670182640b5 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -4,12 +4,36 @@
 # possible alternative: https://github.com/natlownes/docker-latex
 image: listx/texlive:2017
 
-graduator:
-    
+stages:
+ - build
+ - test
+
+pdflatex_builder:
+  stage: build
   before_script:
     - cd latex
   script:
-    - "latexmk -xelatex Tutkielma.tex"
+    - "latexmk -pdf -output-directory=pdflatex/ thesis.tex"
   artifacts:
     paths:
-      - "latex/*.pdf"
+      - "latex/pdflatex/thesis.pdf"
+
+xelatex_builder:
+  stage: build
+  before_script:
+    - cd latex
+  script:
+    - "latexmk -xelatex -output-directory=xelatex/ thesis.tex"
+  artifacts:
+    paths:
+      - "latex/xelatex/thesis.pdf"
+
+pdflatex_content_validator:
+  stage: test
+  script:
+    - "pdfinfo latex/pdflatex/thesis.pdf |grep '^Pages: *13$'"
+
+xelatex_content_validator:
+  stage: test
+  script:
+    - "pdfinfo latex/xelatex/thesis.pdf |grep '^Pages: *13$'"
diff --git a/latex/Johdanto.tex b/latex/Johdanto.tex
deleted file mode 100644
index 0378ef8614b3a1e26577d3e654546a74c03b7156..0000000000000000000000000000000000000000
--- a/latex/Johdanto.tex
+++ /dev/null
@@ -1,54 +0,0 @@
-\chapter{Johdanto}
-\label{Johdanto}
-
-Viittaaminen lukuun \ref{Johdanto}, toiseen lukuun \ref{Toinen luku}, alilukuun \ref{Alaotsikko}, tätä alempaan lukuun \ref{Alempiotsikko}, alimpaan lukuun \ref{Alinotsikko}, kuvaan \ref{Kuva esimerkki} ja tauluun \ref{Taulu esimerkki}.
-
-Kuva liitetäään seuraavasti. ShareLaTeXin autocomplete rakentaa koko begin-end blockin yleensä puolestasi.
-
-\begin{figure}
-\centering
-\includegraphics[width=0.5\textwidth]{kuvat/turun_yliopisto_logo_rgb.png}
-\caption{Kuvan otsikko}
-\label{Kuva esimerkki}
-\end{figure}
-
-Taulukkoja tehdään seuraavasti.
-
-\begin{table}
-\centering
-\caption{Taulukon otsikko tulee taulun yläpuolelle}
-\begin{tabular}{l|c|r|}
- Taulun             &   elementit   & erotetaan \\
- \hline
- toisistaan         &   et-merkillä & \\
- soluja voi myös    &               & jättää tyhjäksi
-\end{tabular}
-\label{Taulu esimerkki}
-\end{table}
-
-Kirjallisuusviitteet lisätään bib-muodossa bibliografia tiedostoon ja niihin viitataan niiden ID:llä, joka on bib-muodon ensimmäinen kenttä \cite{crawley2007write}.
-
-\section{Alaotsikko}
-\label{Alaotsikko}
-
-Uskonpuhdistuksen myötä suomi tuli koko jumalanpalveluksen kieleksi. Raamattu ja liturgiset kirjat oli siksi saatava suomeksi. Maahan tarvittiin suomea osaavia pappeja; kouluihin piti sen vuoksi saada suomen kielen opetusta, ja sitä varten tarvittiin oppikirjoja. Nämä asiat olivat nuoren Mikael Agricolan kannustimena, kun hän aloitti elämäntyönsä suomen kirjakielen kehittäjänä.
-
-Agricola opiskeli monen muun suomalaisnuorukaisen tavoin Wittenbergissä. Jo ennen Wittenbergin vuosia hän oli saanut valmiiksi Abckirian ja Rucouskirian. Abckiria oli tarkoitettu oppikirjaksi. Se sisälsi aakkoset, tavausharjoituksia ja katekismuksen. Laajassa Rucouskiriassa on rukousten lisäksi Raamatun tekstejä, muun muassa 41 psalmia. Alussa on monipuolinen kalendaario, joka sisältää esimerkiksi ruokailu- ja terveydenhoito-ohjeita ja jopa jonkinlaisen horoskoopin.
-
-Uutta testamenttia Agricola käänsi Wittenbergissä apuneuvoinaan kaksi latinalaista, kaksi saksalaista ja kaksi ruotsalaista käännöstä. Se Wsi Testamenti ilmestyi 1548. Kirjan sanasto ja muoto-oppi on siinä määrin epäyhtenäistä, että on arveltu, että käännöksellä on Agricolan lisäksi ollut myös muita viimeistelijöitä.
-
-Agricolan osuus 1551 ilmestyneen Psalttarin psalmisuomennoksista on epäselvä. Suuri osa psalmeista onkin todennäköisesti suomennettu Turun koulussa Paavali Juustenin johdolla. Juusten itse on kirjoittanut Psalttarista Suomen piispainkronikassa (suom. Simo Heininen): ”Mutta ei ole ollenkaan väliä, kenen nimissä se on julkaistu, sillä se on käännetty, jotta siitä olisi suurta hyötyä Suomen kansalle.” Pääosa Psalttarin esipuheista on Agricolan omaa tekstiä. Runomuotoiseen esipuheeseen sisältyy ansiokas luettelo suomalaisten pakanallisista jumalista. Agricola suomensi myös osia Mooseksen kirjoista ja profeetoista. Hänen nimissään on ilmestynyt suomeksi noin 2/5 Raamatusta. Toinen esimerkki viittaamisesta, jossa myös cite komennon tagi löytyy Bibliografia.bib tiedostosta \cite{puasuareanu2009survey}.
-
-\subsection{Alempiotsikko}
-\label{Alempiotsikko}
-
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam eget tellus porttitor, tempus lacus non, pellentesque ligula. Donec sit amet erat condimentum, feugiat mi accumsan, euismod quam.
-
-Mauris laoreet maximus aliquet. Mauris at gravida elit. Ut nec lobortis elit. Sed lacinia nisi in ex sollicitudin, ac consequat lacus imperdiet. Etiam et velit eu lacus maximus faucibus.
-
-\subsubsection{Alinotsikko, joka ei näy sisällysluettelossa}
-\label{Alinotsikko}
-
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam eget tellus porttitor, tempus lacus non, pellentesque ligula. Donec sit amet erat condimentum, feugiat mi accumsan, euismod quam.
-
-\paragraph{Otsikko tekstissä, joka ei näy sisällysluettelossa}Mauris laoreet maximus aliquet. Mauris at gravida elit. Ut nec lobortis elit. Sed lacinia nisi in ex sollicitudin, ac consequat lacus imperdiet. Etiam et velit eu lacus maximus faucibus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec vulputate tellus ullamcorper odio sodales, non scelerisque neque eleifend. 
\ No newline at end of file
diff --git a/latex/Tiivistelma.tex b/latex/Tiivistelma.tex
deleted file mode 100644
index 710d41d58f31b23008c9af202fab45666aef6b51..0000000000000000000000000000000000000000
--- a/latex/Tiivistelma.tex
+++ /dev/null
@@ -1,26 +0,0 @@
-\begin{ittiivis}{tähän, lista, avainsanoista}
-Tarkempia ohjeita tiivistelmäsivun laadintaan läytyy opiskelijan
-yleisoppaasta, josta alla lyhyt katkelma.
-
-Bibliografisten tietojen jälkeen kirjoitetaan varsinainen tiivistelmä.
-Sen on oletettava, että lukijalla on yleiset tiedot aiheesta.
-Tiivistelmän tulee olla ymmärrettävissä ilman tarvetta perehtyä koko
-tutkielmaan. Se on kirjoitettava täydellisinä virkkeinä,
-väliotsakeluettelona. On käytettävä vakiintuneita termejä. Viittauksia
-ja lainauksia tiivistelmään ei saa sisällyttää, eikä myäskään tietoja
-tai väitteitä, jotka eivät sisälly itse tutkimukseen. Tiivistelmän on
-oltava mahdollisimman ytimekäs n. 120 -- 250 sanan pituinen itsenäinen
-kokonaisuus, joka mahtuu ykkäsvälillä kirjoitettuna vaivatta
-tiivistelmäsivulle. Tiivistelmässä tulisi ilmetä mm.  tutkielman aihe
-tutkimuksen kohde, populaatio, alue ja tarkoitus käytetyt
-tutkimusmenetelmät (mikäli tutkimus on luonteeltaan teoreettinen ja
-tiettyyn kirjalliseen materiaaliin, on mainittava tärkeimmät
-lähdeteokset; mikäli on luonteeltaan empiirinen, on mainittava käytetyt
-metodit) keskeiset tutkimustulokset tulosten perusteella tehdyt
-päätelmät ja toimenpidesuositukset asiasanat
-\end{ittiivis}
-
-% if your thesis is in english then this is also required (is it???)
-%\begin{itabstract}{list, of, keywords}
-%If your thesis is in english this might also be required???
-%\end{itabstract}
\ No newline at end of file
diff --git a/latex/Toinen_Luku.tex b/latex/Toinen_Luku.tex
deleted file mode 100644
index b2d471b0e553ca57a58e1e56fef38129ad7726d7..0000000000000000000000000000000000000000
--- a/latex/Toinen_Luku.tex
+++ /dev/null
@@ -1,4 +0,0 @@
-\chapter{Toisen luvun otsikko}
-\label{Toinen luku}
-
-Lisää tekstiä. Lisää tekstiä. Lisää tekstiä. Lisää tekstiä. Lisää tekstiä. Lisää tekstiä. Lisää tekstiä. Lisää tekstiä. Lisää tekstiä. Lisää tekstiä. Lisää tekstiä. Lisää tekstiä.
\ No newline at end of file
diff --git a/latex/Tutkielma.tex b/latex/Tutkielma.tex
deleted file mode 100644
index e68c72ba0ccba177024eae42d6af9921cd1ac188..0000000000000000000000000000000000000000
--- a/latex/Tutkielma.tex
+++ /dev/null
@@ -1,212 +0,0 @@
-%
-% Document template suitable for use as a latex master-file for masters
-% thesis in University of Turku Department of Future Technologies. 
-% Relies on itpackage.sty for additional definitions.
-%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% load all required packages
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-% document is based on report class
-\documentclass[a4paper,12pt]{report}
-
-% load ams-packages for maths
-\usepackage{amssymb,amsthm,amsmath}
-
-% load babel-package for automatic hyphenation
-\usepackage[finnish]{babel}
-% JH: modified latin to UTF-8 encoding cues to make Scandinavian characters works
-\usepackage[utf8]{inputenc}
-
-% load graphicx package
-%   - automagically select proper parameters depending on whether
-%     we're running pdflatex or latex
-%   - specify \includegraphics{file} without the file extension
-%     (.eps /.pdf (/ .png / .jpeg / ...)), tex should select the proper file
-%
-\usepackage{ifpdf}
-\usepackage{graphicx}
-%% !!! NOTE: if you have ancient LaTeX distribution then you might need to
-%% use the following instead
-%% \newif\ifpdf
-%% \ifx\pdfoutput\undefined
-%%   \pdffalse
-%% \else
-%%   \pdfoutput=1
-%%   \pdftrue
-%% \fi
-%% % if graphicx complains about option clash remove the [pdftex] option
-%% \ifpdf
-%%   \usepackage[pdftex]{graphicx}
-%% \else
-%%   \usepackage[dvips]{graphicx}
-%% \fi
-
-
-% load tocbibind package 
-%   - do not include table of contents in itself
-%   - convert the name of bibliography to references
-\usepackage[nottoc]{tocbibind}
-
-% load sverb package
-%   - enhanced handling of verbatim stuff; listing environment
-\usepackage{sverb}
-
-% load listings package
-%   - handle inclusion of source code
-\usepackage{listings}
-
-% load fancyheaders package
-%   - the actual headers and footers are set later
-\usepackage{fancyhdr}
-
-% load itpackage 
-%   - additional defines and stuff
-\usepackage{thesis/itpackage}
-
-% uncomment the following snippet to get rid of Luku/Chapter text at the
-% beginning of each Chapter... 
-%\makeatletter
-%\renewcommand{\@chapapp}{\relax}
-%\renewcommand{\@makechapterhead}[1]{%
-%  \vspace*{50\p@}%
-%  {\parindent \z@ \raggedright \normalfont
-%    \ifnum \c@secnumdepth >\m@ne
-%        \huge\bfseries \@chapapp\space \thechapter\space\space
-%    \fi
-%    \interlinepenalty\@M
-%    \Huge \bfseries #1\par\nobreak
-%    \vskip 40\p@
-%  }}
-%\makeatother
-\begin{document}
-
-% Select language here by removing comment from one of the two rows below
-\selectlanguage{finnish}\fintrue
-% \selectlanguage{english}\finfalse
-
-% Set some names based on selected language; no modification required
-\iffin
-\settocbibname{Lähdeluettelo}
-\renewcommand{\appname}{Liitteet}
-\else
-\settocbibname{References}
-\renewcommand{\appname}{Appendices}
-\fi
-
-% Fill in your information below
-\workinfo{My Name}
-{Name of Thesis}
-{First Supervisor}
-{Second Supervisor}
-{Year}
-{Month}
-{Kuukausi}
-
-% Set the type of your thesis (Diplomityö, TkK -tutkielma, etc.) and
-% laboratory or field of study below
-\worktype{Type of thesis}{Tutkielman tyyppi} 
-\deptinfo{Laboratory Name}{Labran Nimi}
-
-% Generate the title page 
-\gentitle
-
-% Include the abstract
-\input{Tiivistelma}
-
-% empty pagestyle for table of contents etc. 
-%
-% the redefinition of plain style works also for 1st pages of chapters,
-% which is the default in report class. Just state \thispagestyle{empty}
-% after \chapter{something} if you want empty style for the 1st pages. 
-%
-\pagestyle{empty}
-\fancypagestyle{plain}{
-  \fancyhf{}
-  \renewcommand{\headrulewidth}{0 pt}
-}
-
-% roman numbering for table of contents etc.
-\pagenumbering{roman}
-
-% insert table of contents, list of figures, list of tables
-%
-% setting the counter to zero effectively removes the page number from
-% the toc, lof etc. entries in the toc since there is no roman numeral
-% for zero ;-) (if you want them without numbering)
-%
-%\setcounter{page}{0}
-\tableofcontents
-\clearpage
-%\setcounter{page}{0}
-%\listoffigures 
-%\clearpage
-%\setcounter{page}{0}
-%\listoftables
-
-% possibly insert 'list of acronyms'
-%
-%   - create a chapter called List Of Acronyms (or whatever), which
-%     should contain all your acronym definitions, e.g. 
-%     \chapter{List Of Acronyms} 
-%   - the secnumdepth trickery is needed because acronyms are as a
-%     standard chapter and we are faking '\listofacronyms'
-%
-%\setcounter{secnumdepth}{-1}
-%\input{your acronym chapter's file name}
-%\setcounter{secnumdepth}{2}
-
-% setup page numbering, page counter, etc.
-\startpages
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% Thesis starts here. Create a new tex file for each chapter and input it below. You may encounter errors if you use å, ä, ö or <space> characters in referred names.
-%
-% Good luck!
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-\input{Johdanto}
-\input{Toinen_Luku}
-%\input{file_name_of_chapter_x}
-%\input{file_name_of_chapter_y}
-
-
-% insert references
-%  - included unsrtf.bst provides finnish language version of unsrt
-\iffin
-\bibliographystyle{thesis/unsrtf}
-\else
-\bibliographystyle{unsrt}
-\fi
-\bibliography{Bibliografia}
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% Almost there....
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-% make sure pagecount is correct even if references overflow to a new page
-\pagebreak\addtocounter{page}{-1}
-\eofpages
-\appendices
-
-% create your appendix chapters with command \appchapter{some name} instead
-% of \chapter{some name} for the automagic page counting to work
-%\input{file name of appchapter xxx}
-%\input{file name of appchapter yyy}
-%\input{file name of appchapter zzz}
-%\input{and so on}
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% main document ends here
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\eofapppages
-\end{document}
\ No newline at end of file
diff --git a/latex/abstract.lyx b/latex/abstract.lyx
new file mode 100644
index 0000000000000000000000000000000000000000..9cd61ba1275442be8043a26b9bcd1c4e509c0269
--- /dev/null
+++ b/latex/abstract.lyx
@@ -0,0 +1,145 @@
+#LyX 2.3 created this file. For more info see http://www.lyx.org/
+\lyxformat 544
+\begin_document
+\begin_header
+\save_transient_properties true
+\origin unavailable
+\textclass utuftthesis
+\use_default_options false
+\maintain_unincluded_children false
+\language finnish
+\language_package auto
+\inputencoding utf8
+\fontencoding global
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
+\font_default_family default
+\use_non_tex_fonts true
+\font_sc false
+\font_osf false
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype false
+\use_dash_ligatures true
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\pdf_bookmarks true
+\pdf_bookmarksnumbered false
+\pdf_bookmarksopen false
+\pdf_bookmarksopenlevel 1
+\pdf_breaklinks false
+\pdf_pdfborder false
+\pdf_colorlinks false
+\pdf_backref false
+\pdf_pdfusetitle true
+\pdf_pagemode FullScreen
+\papersize default
+\use_geometry true
+\use_package amsmath 2
+\use_package amssymb 2
+\use_package cancel 0
+\use_package esint 0
+\use_package mathdots 1
+\use_package mathtools 0
+\use_package mhchem 1
+\use_package stackrel 0
+\use_package stmaryrd 0
+\use_package undertilde 0
+\cite_engine biblatex
+\cite_engine_type default
+\biblio_style plain
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 0
+\use_minted 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 2
+\tocdepth 2
+\paragraph_separation indent
+\paragraph_indentation default
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style swedish
+\dynamic_quotes 0
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tracking_changes false
+\output_changes false
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\end_header
+
+\begin_body
+
+\begin_layout Keywords
+tähän, lista, avainsanoista
+\end_layout
+
+\begin_layout KeywordsEnglish
+here, a, list, of, keywords
+\end_layout
+
+\begin_layout Abstract
+Tarkempia ohjeita tiivistelmäsivun laadintaan läytyy opiskelijan yleisoppaasta,
+ josta alla lyhyt katkelma.
+\end_layout
+
+\begin_layout Abstract
+Bibliografisten tietojen jälkeen kirjoitetaan varsinainen tiivistelmä.
+ Sen on oletettava, että lukijalla on yleiset tiedot aiheesta.
+ Tiivistelmän tulee olla ymmärrettävissä ilman tarvetta perehtyä koko tutkielmaa
+n.
+ Se on kirjoitettava täydellisinä virkkeinä, väliotsakeluettelona.
+ On käytettävä vakiintuneita termejä.
+ Viittauksia ja lainauksia tiivistelmään ei saa sisällyttää, eikä myäskään
+ tietoja tai väitteitä, jotka eivät sisälly itse tutkimukseen.
+ Tiivistelmän on oltava mahdollisimman ytimekäs n.
+ 120–250 sanan pituinen itsenäinen kokonaisuus, joka mahtuu ykkäsvälillä
+ kirjoitettuna vaivatta tiivistelmäsivulle.
+ Tiivistelmässä tulisi ilmetä mm.
+  tutkielman aihe tutkimuksen kohde, populaatio, alue ja tarkoitus käytetyt
+ tutkimusmenetelmät (mikäli tutkimus on luonteeltaan teoreettinen ja tiettyyn
+ kirjalliseen materiaaliin, on mainittava tärkeimmät lähdeteokset; mikäli
+ on luonteeltaan empiirinen, on mainittava käytetyt metodit) keskeiset tutkimust
+ulokset tulosten perusteella tehdyt päätelmät ja toimenpidesuositukset asiasanat
+\end_layout
+
+\begin_layout Standard
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+Second abstract in english(in case the document is written in non-english)
+\end_layout
+
+\begin_layout Plain Layout
+comment if not needed
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout AbstractEnglish
+If your thesis is in english this might also be required???
+\end_layout
+
+\end_body
+\end_document
diff --git a/latex/abstract.tex b/latex/abstract.tex
new file mode 100644
index 0000000000000000000000000000000000000000..dcbd2185cb85d7c48974454867e51d12b967d72e
--- /dev/null
+++ b/latex/abstract.tex
@@ -0,0 +1,29 @@
+
+\keywords{tähän, lista, avainsanoista}
+
+\keywordstwo{here, a, list, of, keywords}
+\begin{abstract}
+Tarkempia ohjeita tiivistelmäsivun laadintaan läytyy opiskelijan yleisoppaasta,
+josta alla lyhyt katkelma.
+
+Bibliografisten tietojen jälkeen kirjoitetaan varsinainen tiivistelmä.
+Sen on oletettava, että lukijalla on yleiset tiedot aiheesta. Tiivistelmän
+tulee olla ymmärrettävissä ilman tarvetta perehtyä koko tutkielmaan.
+Se on kirjoitettava täydellisinä virkkeinä, väliotsakeluettelona.
+On käytettävä vakiintuneita termejä. Viittauksia ja lainauksia tiivistelmään
+ei saa sisällyttää, eikä myäskään tietoja tai väitteitä, jotka eivät
+sisälly itse tutkimukseen. Tiivistelmän on oltava mahdollisimman ytimekäs
+n. 120–250 sanan pituinen itsenäinen kokonaisuus, joka mahtuu ykkäsvälillä
+kirjoitettuna vaivatta tiivistelmäsivulle. Tiivistelmässä tulisi ilmetä
+mm.  tutkielman aihe tutkimuksen kohde, populaatio, alue ja tarkoitus
+käytetyt tutkimusmenetelmät (mikäli tutkimus on luonteeltaan teoreettinen
+ja tiettyyn kirjalliseen materiaaliin, on mainittava tärkeimmät lähdeteokset;
+mikäli on luonteeltaan empiirinen, on mainittava käytetyt metodit)
+keskeiset tutkimustulokset tulosten perusteella tehdyt päätelmät ja
+toimenpidesuositukset asiasanat
+\end{abstract}
+
+\begin{abstracten}
+If your thesis is in english this might also be required???
+\end{abstracten}
+
diff --git a/latex/johdanto.lyx b/latex/johdanto.lyx
new file mode 100644
index 0000000000000000000000000000000000000000..9cde4bd91c5075565868f80224f191cc6b5bfa46
--- /dev/null
+++ b/latex/johdanto.lyx
@@ -0,0 +1,520 @@
+#LyX 2.3 created this file. For more info see http://www.lyx.org/
+\lyxformat 544
+\begin_document
+\begin_header
+\save_transient_properties true
+\origin unavailable
+\textclass utuftthesis
+\use_default_options false
+\maintain_unincluded_children false
+\language finnish
+\language_package none
+\inputencoding utf8
+\fontencoding default
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
+\font_default_family default
+\use_non_tex_fonts true
+\font_sc false
+\font_osf false
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype false
+\use_dash_ligatures true
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\papersize default
+\use_geometry true
+\use_package amsmath 1
+\use_package amssymb 0
+\use_package cancel 0
+\use_package esint 1
+\use_package mathdots 0
+\use_package mathtools 0
+\use_package mhchem 0
+\use_package stackrel 0
+\use_package stmaryrd 0
+\use_package undertilde 0
+\cite_engine biblatex
+\cite_engine_type default
+\biblio_style plain
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 0
+\use_minted 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\paragraph_indentation default
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style swedish
+\dynamic_quotes 0
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tracking_changes false
+\output_changes false
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\end_header
+
+\begin_body
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+chapter{Johdanto}
+\end_layout
+
+\end_inset
+
+ 
+\begin_inset CommandInset label
+LatexCommand label
+name "Johdanto"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Viittaaminen lukuun 
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "Johdanto"
+plural "false"
+caps "false"
+noprefix "false"
+
+\end_inset
+
+, toiseen lukuun 
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "Toinen luku"
+plural "false"
+caps "false"
+noprefix "false"
+
+\end_inset
+
+, alilukuun 
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "Alaotsikko"
+plural "false"
+caps "false"
+noprefix "false"
+
+\end_inset
+
+, tätä alempaan lukuun 
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "Alempiotsikko"
+plural "false"
+caps "false"
+noprefix "false"
+
+\end_inset
+
+, alimpaan lukuun 
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "Alinotsikko"
+plural "false"
+caps "false"
+noprefix "false"
+
+\end_inset
+
+, kuvaan 
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "Kuva esimerkki"
+plural "false"
+caps "false"
+noprefix "false"
+
+\end_inset
+
+ ja tauluun 
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "Tauluesimerkki"
+plural "false"
+caps "false"
+noprefix "false"
+
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+Kuva liitetään seuraavasti.
+ ShareLaTeXin autocomplete rakentaa koko begin-end blockin yleensä puolestasi.
+\end_layout
+
+\begin_layout Standard
+\begin_inset Float figure
+wide false
+sideways false
+status open
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+
+\backslash
+centering
+\end_layout
+
+\end_inset
+
+ 
+\begin_inset Graphics
+	filename kuvat/turun-yliopisto-logo-rgb.png
+	width 50text%
+
+\end_inset
+
+ 
+\begin_inset Caption Standard
+
+\begin_layout Plain Layout
+Kuvan otsikko
+\end_layout
+
+\end_inset
+
+
+\begin_inset CommandInset label
+LatexCommand label
+name "Kuva esimerkki"
+
+\end_inset
+
+ 
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Taulukkoja tehdään seuraavasti.
+\end_layout
+
+\begin_layout Standard
+\begin_inset Float table
+wide false
+sideways false
+status open
+
+\begin_layout Plain Layout
+\align center
+\begin_inset Caption Standard
+
+\begin_layout Plain Layout
+Taulukon otsikko tulee taulun yläpuolelle
+\end_layout
+
+\end_inset
+
+
+\begin_inset Tabular
+<lyxtabular version="3" rows="3" columns="3">
+<features tabularvalignment="middle">
+<column alignment="left" valignment="top">
+<column alignment="center" valignment="top">
+<column alignment="right" valignment="top">
+<row>
+<cell alignment="left" valignment="top" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Taulun 
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+elementit 
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="right" valignment="top" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+erotetaan 
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="left" valignment="top" topline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+toisistaan 
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+et-merkillä 
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="none" valignment="top" topline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="left" valignment="top" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+soluja voi myös 
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="right" valignment="top" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+jättää tyhjäksi 
+\end_layout
+
+\end_inset
+</cell>
+</row>
+</lyxtabular>
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Plain Layout
+\align center
+\begin_inset CommandInset label
+LatexCommand label
+name "Tauluesimerkki"
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Kirjallisuusviitteet lisätään bib-muodossa bibliografia tiedostoon ja niihin
+ viitataan niiden ID:llä, joka on bib-muodon ensimmäinen kenttä 
+\begin_inset CommandInset citation
+LatexCommand cite
+key "crawley2007write"
+literal "true"
+
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Section
+Alaotsikko
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset label
+LatexCommand label
+name "Alaotsikko"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Uskonpuhdistuksen myötä suomi tuli koko jumalanpalveluksen kieleksi.
+ Raamattu ja liturgiset kirjat oli siksi saatava suomeksi.
+ Maahan tarvittiin suomea osaavia pappeja; kouluihin piti sen vuoksi saada
+ suomen kielen opetusta, ja sitä varten tarvittiin oppikirjoja.
+ Nämä asiat olivat nuoren Mikael Agricolan kannustimena, kun hän aloitti
+ elämäntyönsä suomen kirjakielen kehittäjänä.
+\end_layout
+
+\begin_layout Standard
+Agricola opiskeli monen muun suomalaisnuorukaisen tavoin Wittenbergissä.
+ Jo ennen Wittenbergin vuosia hän oli saanut valmiiksi Abckirian ja Rucouskirian.
+ Abckiria oli tarkoitettu oppikirjaksi.
+ Se sisälsi aakkoset, tavausharjoituksia ja katekismuksen.
+ Laajassa Rucouskiriassa on rukousten lisäksi Raamatun tekstejä, muun muassa
+ 41 psalmia.
+ Alussa on monipuolinen kalendaario, joka sisältää esimerkiksi ruokailu-
+ ja terveydenhoito-ohjeita ja jopa jonkinlaisen horoskoopin.
+\end_layout
+
+\begin_layout Standard
+Uutta testamenttia Agricola käänsi Wittenbergissä apuneuvoinaan kaksi latinalais
+ta, kaksi saksalaista ja kaksi ruotsalaista käännöstä.
+ Se Wsi Testamenti ilmestyi 1548.
+ Kirjan sanasto ja muoto-oppi on siinä määrin epäyhtenäistä, että on arveltu,
+ että käännöksellä on Agricolan lisäksi ollut myös muita viimeistelijöitä.
+\end_layout
+
+\begin_layout Standard
+Agricolan osuus 1551 ilmestyneen Psalttarin psalmisuomennoksista on epäselvä.
+ Suuri osa psalmeista onkin todennäköisesti suomennettu Turun koulussa Paavali
+ Juustenin johdolla.
+ Juusten itse on kirjoittanut Psalttarista Suomen piispainkronikassa (suom.
+ Simo Heininen): 
+\begin_inset Quotes eld
+\end_inset
+
+Mutta ei ole ollenkaan väliä, kenen nimissä se on julkaistu, sillä se on
+ käännetty, jotta siitä olisi suurta hyötyä Suomen kansalle.
+\begin_inset Quotes erd
+\end_inset
+
+ Pääosa Psalttarin esipuheista on Agricolan omaa tekstiä.
+ Runomuotoiseen esipuheeseen sisältyy ansiokas luettelo suomalaisten pakanallisi
+sta jumalista.
+ Agricola suomensi myös osia Mooseksen kirjoista ja profeetoista.
+ Hänen nimissään on ilmestynyt suomeksi noin 2/5 Raamatusta.
+ Toinen esimerkki viittaamisesta, jossa myös cite komennon tagi löytyy Bibliogra
+fia.bib tiedostosta 
+\begin_inset CommandInset citation
+LatexCommand cite
+key "puasuareanu2009survey"
+literal "true"
+
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Subsection
+Alempiotsikko
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset label
+LatexCommand label
+name "Alempiotsikko"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Lorem ipsum dolor sit amet, consectetur adipiscing elit.
+ Etiam eget tellus porttitor, tempus lacus non, pellentesque ligula.
+ Donec sit amet erat condimentum, feugiat mi accumsan, euismod quam.
+\end_layout
+
+\begin_layout Standard
+Mauris laoreet maximus aliquet.
+ Mauris at gravida elit.
+ Ut nec lobortis elit.
+ Sed lacinia nisi in ex sollicitudin, ac consequat lacus imperdiet.
+ Etiam et velit eu lacus maximus faucibus.
+\end_layout
+
+\begin_layout Subsubsection
+Alinotsikko, joka ei näy sisällysluettelossa
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset label
+LatexCommand label
+name "Alinotsikko"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Lorem ipsum dolor sit amet, consectetur adipiscing elit.
+ Etiam eget tellus porttitor, tempus lacus non, pellentesque ligula.
+ Donec sit amet erat condimentum, feugiat mi accumsan, euismod quam.
+\end_layout
+
+\begin_layout Paragraph
+Otsikko tekstissä, joka ei näy sisällysluettelossa
+\end_layout
+
+\begin_layout Standard
+Mauris laoreet maximus aliquet.
+ Mauris at gravida elit.
+ Ut nec lobortis elit.
+ Sed lacinia nisi in ex sollicitudin, ac consequat lacus imperdiet.
+ Etiam et velit eu lacus maximus faucibus.
+ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere
+ cubilia Curae; Donec vulputate tellus ullamcorper odio sodales, non scelerisque
+ neque eleifend.
+ 
+\end_layout
+
+\end_body
+\end_document
diff --git a/latex/johdanto.tex b/latex/johdanto.tex
new file mode 100644
index 0000000000000000000000000000000000000000..28421aa304e3a1f318426b8015580bb4054cd8b6
--- /dev/null
+++ b/latex/johdanto.tex
@@ -0,0 +1,98 @@
+\chapter{Johdanto} \label{Johdanto}
+
+Viittaaminen lukuun \ref{Johdanto}, toiseen lukuun \ref{Toinen luku},
+alilukuun \ref{Alaotsikko}, tätä alempaan lukuun \ref{Alempiotsikko},
+alimpaan lukuun \ref{Alinotsikko}, kuvaan \ref{Kuva esimerkki} ja
+tauluun \ref{Tauluesimerkki}.
+
+Kuva liitetään seuraavasti. ShareLaTeXin autocomplete rakentaa koko
+begin-end blockin yleensä puolestasi.
+
+\begin{figure}
+\centering \includegraphics[width=0.5\textwidth]{kuvat/turun-yliopisto-logo-rgb}
+\caption{Kuvan otsikko}
+\label{Kuva esimerkki} 
+\end{figure}
+Taulukkoja tehdään seuraavasti.
+
+\begin{table}
+\begin{centering}
+\caption{Taulukon otsikko tulee taulun yläpuolelle}
+\begin{tabular}{l|c|r|}
+Taulun  & elementit  & erotetaan \tabularnewline
+\hline 
+toisistaan  & et-merkillä  & \tabularnewline
+soluja voi myös  &  & jättää tyhjäksi \tabularnewline
+\end{tabular}
+\par\end{centering}
+\centering{}\label{Tauluesimerkki}
+\end{table}
+Kirjallisuusviitteet lisätään bib-muodossa bibliografia tiedostoon
+ja niihin viitataan niiden ID:llä, joka on bib-muodon ensimmäinen
+kenttä \cite{crawley2007write}.
+
+\section{Alaotsikko}
+
+\label{Alaotsikko}
+
+Uskonpuhdistuksen myötä suomi tuli koko jumalanpalveluksen kieleksi.
+Raamattu ja liturgiset kirjat oli siksi saatava suomeksi. Maahan tarvittiin
+suomea osaavia pappeja; kouluihin piti sen vuoksi saada suomen kielen
+opetusta, ja sitä varten tarvittiin oppikirjoja. Nämä asiat olivat
+nuoren Mikael Agricolan kannustimena, kun hän aloitti elämäntyönsä
+suomen kirjakielen kehittäjänä.
+
+Agricola opiskeli monen muun suomalaisnuorukaisen tavoin Wittenbergissä.
+Jo ennen Wittenbergin vuosia hän oli saanut valmiiksi Abckirian ja
+Rucouskirian. Abckiria oli tarkoitettu oppikirjaksi. Se sisälsi aakkoset,
+tavausharjoituksia ja katekismuksen. Laajassa Rucouskiriassa on rukousten
+lisäksi Raamatun tekstejä, muun muassa 41 psalmia. Alussa on monipuolinen
+kalendaario, joka sisältää esimerkiksi ruokailu- ja terveydenhoito-ohjeita
+ja jopa jonkinlaisen horoskoopin.
+
+Uutta testamenttia Agricola käänsi Wittenbergissä apuneuvoinaan kaksi
+latinalaista, kaksi saksalaista ja kaksi ruotsalaista käännöstä. Se
+Wsi Testamenti ilmestyi 1548. Kirjan sanasto ja muoto-oppi on siinä
+määrin epäyhtenäistä, että on arveltu, että käännöksellä on Agricolan
+lisäksi ollut myös muita viimeistelijöitä.
+
+Agricolan osuus 1551 ilmestyneen Psalttarin psalmisuomennoksista on
+epäselvä. Suuri osa psalmeista onkin todennäköisesti suomennettu Turun
+koulussa Paavali Juustenin johdolla. Juusten itse on kirjoittanut
+Psalttarista Suomen piispainkronikassa (suom. Simo Heininen): ``Mutta
+ei ole ollenkaan väliä, kenen nimissä se on julkaistu, sillä se on
+käännetty, jotta siitä olisi suurta hyötyä Suomen kansalle.'' Pääosa
+Psalttarin esipuheista on Agricolan omaa tekstiä. Runomuotoiseen esipuheeseen
+sisältyy ansiokas luettelo suomalaisten pakanallisista jumalista.
+Agricola suomensi myös osia Mooseksen kirjoista ja profeetoista. Hänen
+nimissään on ilmestynyt suomeksi noin 2/5 Raamatusta. Toinen esimerkki
+viittaamisesta, jossa myös cite komennon tagi löytyy Bibliografia.bib
+tiedostosta \cite{puasuareanu2009survey}.
+
+\subsection{Alempiotsikko}
+
+\label{Alempiotsikko}
+
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam eget
+tellus porttitor, tempus lacus non, pellentesque ligula. Donec sit
+amet erat condimentum, feugiat mi accumsan, euismod quam.
+
+Mauris laoreet maximus aliquet. Mauris at gravida elit. Ut nec lobortis
+elit. Sed lacinia nisi in ex sollicitudin, ac consequat lacus imperdiet.
+Etiam et velit eu lacus maximus faucibus.
+
+\subsubsection{Alinotsikko, joka ei näy sisällysluettelossa}
+
+\label{Alinotsikko}
+
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam eget
+tellus porttitor, tempus lacus non, pellentesque ligula. Donec sit
+amet erat condimentum, feugiat mi accumsan, euismod quam.
+
+\paragraph{Otsikko tekstissä, joka ei näy sisällysluettelossa}
+
+Mauris laoreet maximus aliquet. Mauris at gravida elit. Ut nec lobortis
+elit. Sed lacinia nisi in ex sollicitudin, ac consequat lacus imperdiet.
+Etiam et velit eu lacus maximus faucibus. Vestibulum ante ipsum primis
+in faucibus orci luctus et ultrices posuere cubilia Curae; Donec vulputate
+tellus ullamcorper odio sodales, non scelerisque neque eleifend. 
diff --git a/latex/kuvat/Untitled-Diagram.pdf b/latex/kuvat/Untitled-Diagram.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..faec67ca3994d321c2705e155d607bd2c70f5f79
Binary files /dev/null and b/latex/kuvat/Untitled-Diagram.pdf differ
diff --git a/latex/kuvat/Untitled_Diagram.pdf b/latex/kuvat/Untitled_Diagram.pdf
deleted file mode 100644
index d04c96ea9a7ecb47571a5b4d6c74ee565ec0eebb..0000000000000000000000000000000000000000
Binary files a/latex/kuvat/Untitled_Diagram.pdf and /dev/null differ
diff --git a/latex/kuvat/turun_yliopisto_logo_rgb.png b/latex/kuvat/turun-yliopisto-logo-rgb.png
similarity index 100%
rename from latex/kuvat/turun_yliopisto_logo_rgb.png
rename to latex/kuvat/turun-yliopisto-logo-rgb.png
diff --git a/latex/thesis.lyx b/latex/thesis.lyx
new file mode 100644
index 0000000000000000000000000000000000000000..4c0dbcbe61fe64a42f007d5872837e1341a7812c
--- /dev/null
+++ b/latex/thesis.lyx
@@ -0,0 +1,760 @@
+#LyX 2.3 created this file. For more info see http://www.lyx.org/
+\lyxformat 544
+\begin_document
+\begin_header
+\save_transient_properties true
+\origin unavailable
+\textclass utuftthesis
+\options a4paper,12pt,language=finnish,hidechapters=true,realtimesnewroman=false
+\use_default_options false
+\maintain_unincluded_children false
+\language finnish
+\language_package default
+\inputencoding auto
+\fontencoding default
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
+\font_default_family default
+\use_non_tex_fonts true
+\font_sc false
+\font_osf false
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype false
+\use_dash_ligatures true
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command biber
+\index_command default
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\pdf_bookmarks false
+\pdf_bookmarksnumbered false
+\pdf_bookmarksopen false
+\pdf_bookmarksopenlevel 1
+\pdf_breaklinks false
+\pdf_pdfborder false
+\pdf_colorlinks false
+\pdf_backref false
+\pdf_pdfusetitle false
+\papersize default
+\use_geometry true
+\use_package amsmath 2
+\use_package amssymb 2
+\use_package cancel 0
+\use_package esint 0
+\use_package mathdots 1
+\use_package mathtools 0
+\use_package mhchem 1
+\use_package stackrel 0
+\use_package stmaryrd 0
+\use_package undertilde 0
+\cite_engine biblatex
+\cite_engine_type authoryear
+\biblio_style plain
+\biblatex_bibstyle ieee
+\biblatex_citestyle ieee
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 0
+\use_minted 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 2
+\tocdepth 2
+\paragraph_separation indent
+\paragraph_indentation default
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style swedish
+\dynamic_quotes 0
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tracking_changes false
+\output_changes false
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\end_header
+
+\begin_body
+
+\begin_layout Standard
+\begin_inset Note Comment
+status open
+
+\begin_layout Plain Layout
+Document template suitable for use as a LaTeX master-file for master's thesis
+ in University of Turku Department of Future Technologies.
+\begin_inset Newline newline
+\end_inset
+
+
+\begin_inset Newline newline
+\end_inset
+
+Compatible with: ShareLaTeX / PDFLaTeX / XeLaTeX.
+\begin_inset Newline newline
+\end_inset
+
+
+\begin_inset Newline newline
+\end_inset
+
+
+\begin_inset Newline newline
+\end_inset
+
+** HOW TO USE? **
+\begin_inset Newline newline
+\end_inset
+
+
+\begin_inset Newline newline
+\end_inset
+
+Want to write a thesis? Clone this template in ShareLaTeX or fork the department
+'s thesis git project.
+\begin_inset Newline newline
+\end_inset
+
+
+\begin_inset Newline newline
+\end_inset
+
+The utuftthesis.cls defines a new thesis class, which is based on the report
+ class.
+ It supports these new named parameters:
+\end_layout
+
+\begin_layout Plain Layout
+- paper: a4paper
+\end_layout
+
+\begin_layout Plain Layout
+- version: draft / final (default: draft) shows/hides [draft] in the header
+\end_layout
+
+\begin_layout Plain Layout
+- language: finnish / english (default:finnish) affects the general document
+ appearance and hyphenation
+\end_layout
+
+\begin_layout Plain Layout
+- hidechapters: true / false (default:true) hides/shows the chapter/luku
+ text at the beginning of each Chapter
+\end_layout
+
+\begin_layout Plain Layout
+- includereferences: true / false (default:false) include reference pages
+ when calculating the total number of pages
+\end_layout
+
+\begin_layout Plain Layout
+- realtimesnewroman: true / false (default:false) use Times New Roman instead
+ of LaTeX fonts with XeLaTeX.
+ Requires the font to be installed on the system / provided in the document
+ directory.
+ Other fonts can be defined with 
+\backslash
+setmainfont.
+\end_layout
+
+\begin_layout Plain Layout
+- sharelatex: true / false (default: false) don't attempt to use (c) system
+ fonts, instead read them from the project repository
+\begin_inset Newline newline
+\end_inset
+
+
+\begin_inset Newline newline
+\end_inset
+
+Traditionally the best places to learn (La)TeX are probably the manual pages
+ for each package http://www.ctan.org/ and http://www.ctan.org/tex-archive/info/lsho
+rt/english/lshort.pdf.
+ This new version (2.0) should be compatible with xelatex and biblatex which
+ means that all source files can freely use normal UTF-8 text without resorting
+ to ""legacy hacks".
+\begin_inset Newline newline
+\end_inset
+
+
+\begin_inset Newline newline
+\end_inset
+
+Note that PDF/A requirements don't allow PDF links, but if you want to provide
+ a user friendly version of the thesis with links, use 
+\backslash
+hyperref
+\begin_inset Newline newline
+\end_inset
+
+
+\begin_inset Newline newline
+\end_inset
+
+
+\begin_inset Newline newline
+\end_inset
+
+** Maintenance **
+\begin_inset Newline newline
+\end_inset
+
+
+\begin_inset Newline newline
+\end_inset
+
+Workflow: https://gitlab.utu.fi/ttweb/thesis -> master .lyx document exported
+ as .tex documents -> repository content dumped to the sharelatex project
+ template
+\end_layout
+
+\begin_layout Plain Layout
+Want to fix something in the template? Send a merge.
+\begin_inset Newline newline
+\end_inset
+
+
+\begin_inset Newline newline
+\end_inset
+
+Relies on utuftthesis.cls for the document class definitions.
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout PubYear
+2018
+\end_layout
+
+\begin_layout PubMonth
+6
+\end_layout
+
+\begin_layout PubLab
+Labran nimi
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+}{Laboratory Name
+\end_layout
+
+\end_inset
+
+
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+looks a bit funny in LyX.
+ Gotta learn how to fix this..
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout PubType
+tkk
+\end_layout
+
+\begin_layout Title
+Name of Thesis
+\end_layout
+
+\begin_layout Author
+My Name
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset include
+LatexCommand input
+filename "abstract.lyx"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Note Comment
+status open
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+
+
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+% empty pagestyle for table of contents etc.
+ 
+\end_layout
+
+\begin_layout Plain Layout
+
+% the redefinition of plain style works also for 1st pages of chapters,
+\end_layout
+
+\begin_layout Plain Layout
+
+% which is the default in report class.
+\end_layout
+
+\begin_layout Plain Layout
+
+% Just state 
+\backslash
+thispagestyle{empty} after 
+\backslash
+chapter{something} if you want
+\end_layout
+
+\begin_layout Plain Layout
+
+% empty style for the 1st pages.
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+pagestyle{empty}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+fancypagestyle{plain}{
+\end_layout
+
+\begin_layout Plain Layout
+
+  
+\backslash
+fancyhf{}
+\end_layout
+
+\begin_layout Plain Layout
+
+  
+\backslash
+renewcommand{
+\backslash
+headrulewidth}{0 pt}
+\end_layout
+
+\begin_layout Plain Layout
+
+}
+\end_layout
+
+\end_inset
+
+
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+% roman numbering for table of contents etc.
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+pagenumbering{roman}
+\end_layout
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\begin_layout Plain Layout
+
+% insert table of contents, list of figures, list of tables
+\end_layout
+
+\begin_layout Plain Layout
+
+%
+\end_layout
+
+\begin_layout Plain Layout
+
+% setting the counter to zero effectively removes the page number from
+\end_layout
+
+\begin_layout Plain Layout
+
+% the toc, lof etc.
+ entries in the toc since there is no roman numeral
+\end_layout
+
+\begin_layout Plain Layout
+
+% for zero ;-) (if you want them without numbering)
+\end_layout
+
+\begin_layout Plain Layout
+
+%
+\end_layout
+
+\begin_layout Plain Layout
+
+%
+\backslash
+setcounter{page}{0}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+tableofcontents
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+clearpage
+\end_layout
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\begin_layout Plain Layout
+
+%
+\backslash
+setcounter{page}{0}
+\end_layout
+
+\begin_layout Plain Layout
+
+%
+\backslash
+listoffigures 
+\end_layout
+
+\begin_layout Plain Layout
+
+%
+\backslash
+clearpage
+\end_layout
+
+\begin_layout Plain Layout
+
+%
+\backslash
+setcounter{page}{0}
+\end_layout
+
+\begin_layout Plain Layout
+
+%
+\backslash
+listoftables
+\end_layout
+
+\end_inset
+
+
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+% possibly insert 'list of acronyms'
+\end_layout
+
+\begin_layout Plain Layout
+
+%
+\end_layout
+
+\begin_layout Plain Layout
+
+%   - create a chapter called List Of Acronyms (or whatever), which
+\end_layout
+
+\begin_layout Plain Layout
+
+%     should contain all your acronym definitions, e.g.
+ 
+\end_layout
+
+\begin_layout Plain Layout
+
+%     
+\backslash
+chapter{List Of Acronyms} 
+\end_layout
+
+\begin_layout Plain Layout
+
+%   - the secnumdepth trickery is needed because acronyms are as a
+\end_layout
+
+\begin_layout Plain Layout
+
+%     standard chapter and we are faking '
+\backslash
+listofacronyms'
+\end_layout
+
+\begin_layout Plain Layout
+
+%
+\end_layout
+
+\begin_layout Plain Layout
+
+%
+\backslash
+setcounter{secnumdepth}{-1}
+\end_layout
+
+\begin_layout Plain Layout
+
+%
+\backslash
+input{your acronym chapter's file name}
+\end_layout
+
+\begin_layout Plain Layout
+
+%
+\backslash
+setcounter{secnumdepth}{2}
+\end_layout
+
+\end_inset
+
+
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+% setup page numbering, page counter, etc.
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+startpages
+\end_layout
+
+\end_inset
+
+
+\begin_inset Note Comment
+status open
+
+\begin_layout Plain Layout
+The thesis starts here.
+\end_layout
+
+\begin_layout Plain Layout
+To better organize things, create a new tex file for each chapter and input
+ it below.
+\end_layout
+
+\begin_layout Plain Layout
+Avoid using the å, ä, ö or <space> characters in referred names and underscores
+ _ in file names (may break hyperref).
+\end_layout
+
+\begin_layout Plain Layout
+Good luck!
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset include
+LatexCommand input
+filename "johdanto.lyx"
+
+\end_inset
+
+
+\begin_inset CommandInset include
+LatexCommand input
+filename "toinenluku.lyx"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+%
+\backslash
+input{file_name_of_chapter_x}
+\end_layout
+
+\begin_layout Plain Layout
+
+%
+\backslash
+input{file_name_of_chapter_y}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Note Comment
+status open
+
+\begin_layout Plain Layout
+The thesis main content ends here.
+\end_layout
+
+\end_inset
+
+
+\begin_inset CommandInset bibtex
+LatexCommand bibtex
+btprint "btPrintCited"
+bibfiles "Bibliografia"
+options "plain"
+
+\end_inset
+
+
+\begin_inset Note Comment
+status open
+
+\begin_layout Plain Layout
+Don't include this if appendices are not present.
+ On the other hand, without this call, the appendices don't look right.
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+appendices 
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Note Comment
+status open
+
+\begin_layout Plain Layout
+Create your appendix chapters with command 
+\backslash
+appchapter{some name} instead of 
+\backslash
+chapter{some name} for the automagic page counting to work!
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Appendix
+Liitedokumentti
+\end_layout
+
+\begin_layout Standard
+Tässä esimerkki
+\begin_inset Newpage pagebreak
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+kaksisivuisesta liitteestä.
+\end_layout
+
+\begin_layout Appendix
+Liitedokumentti 2
+\end_layout
+
+\begin_layout Standard
+Tässä esimerkki
+\begin_inset Newpage pagebreak
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+toisesta kaksisivuisesta liitteestä.
+\end_layout
+
+\begin_layout Standard
+\begin_inset Note Comment
+status open
+
+\begin_layout Plain Layout
+main document ends here
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_body
+\end_document
diff --git a/latex/thesis.pdf b/latex/thesis.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..d67300e44fb04239762a0eac0642b27a3e057c52
Binary files /dev/null and b/latex/thesis.pdf differ
diff --git a/latex/thesis.tex b/latex/thesis.tex
new file mode 100644
index 0000000000000000000000000000000000000000..cd6d370293c6410e100f69ed9b11140d5cc90d76
--- /dev/null
+++ b/latex/thesis.tex
@@ -0,0 +1,181 @@
+%% LyX 2.3.1 created this file.  For more info, see http://www.lyx.org/.
+%% Do not edit unless you really know what you are doing.
+\documentclass[a4paper,12pt,language=finnish,hidechapters=true,realtimesnewroman=false]{utuftthesis}
+\setcounter{secnumdepth}{2}
+\setcounter{tocdepth}{2}
+\usepackage{verbatim}
+
+\makeatletter
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
+%% Because html converters don't know tabularnewline
+\providecommand{\tabularnewline}{\\}
+
+\makeatother
+
+\addbibresource{Bibliografia.bib}
+\begin{document}
+\begin{comment}
+Document template suitable for use as a LaTeX master-file for master's
+thesis in University of Turku Department of Future Technologies.\\
+\\
+Compatible with: ShareLaTeX / PDFLaTeX / XeLaTeX.\\
+\\
+\\
+{*}{*} HOW TO USE? {*}{*}\\
+\\
+Want to write a thesis? Clone this template in ShareLaTeX or fork
+the department's thesis git project.\\
+\\
+The utuftthesis.cls defines a new thesis class, which is based on
+the report class. It supports these new named parameters:
+
+- paper: a4paper
+
+- version: draft / final (default: draft) shows/hides {[}draft{]}
+in the header
+
+- language: finnish / english (default:finnish) affects the general
+document appearance and hyphenation
+
+- hidechapters: true / false (default:true) hides/shows the chapter/luku
+text at the beginning of each Chapter
+
+- includereferences: true / false (default:false) include reference
+pages when calculating the total number of pages
+
+- realtimesnewroman: true / false (default:false) use Times New Roman
+instead of LaTeX fonts with XeLaTeX. Requires the font to be installed
+on the system / provided in the document directory. Other fonts can
+be defined with \textbackslash setmainfont.
+
+- sharelatex: true / false (default: false) don't attempt to use (c)
+system fonts, instead read them from the project repository\\
+\\
+Traditionally the best places to learn (La)TeX are probably the manual
+pages for each package http://www.ctan.org/ and http://www.ctan.org/tex-archive/info/lshort/english/lshort.pdf.
+This new version (2.0) should be compatible with xelatex and biblatex
+which means that all source files can freely use normal UTF-8 text
+without resorting to \textquotedbl\textquotedbl legacy hacks\textquotedbl .\\
+\\
+Note that PDF/A requirements don't allow PDF links, but if you want
+to provide a user friendly version of the thesis with links, use \textbackslash hyperref\\
+\\
+\\
+{*}{*} Maintenance {*}{*}\\
+\\
+Workflow: https://gitlab.utu.fi/ttweb/thesis -> master .lyx document
+exported as .tex documents -> repository content dumped to the sharelatex
+project template
+
+Want to fix something in the template? Send a merge.\\
+\\
+Relies on utuftthesis.cls for the document class definitions.
+\end{comment}
+
+
+\pubyear{2018}
+
+\pubmonth{6}
+
+\publab{Labran nimi}{Laboratory Name}
+
+\pubtype{tkk}
+\title{Name of Thesis}
+\author{My Name}
+
+\maketitle
+\input{abstract.tex}
+
+\begin{comment}
+\end{comment}
+% empty pagestyle for table of contents etc. 
+% the redefinition of plain style works also for 1st pages of chapters,
+% which is the default in report class.
+% Just state \thispagestyle{empty} after \chapter{something} if you want
+% empty style for the 1st pages.
+\pagestyle{empty}
+\fancypagestyle{plain}{
+  \fancyhf{}
+  \renewcommand{\headrulewidth}{0 pt}
+}% roman numbering for table of contents etc.
+\pagenumbering{roman}
+
+% insert table of contents, list of figures, list of tables
+%
+% setting the counter to zero effectively removes the page number from
+% the toc, lof etc. entries in the toc since there is no roman numeral
+% for zero ;-) (if you want them without numbering)
+%
+%\setcounter{page}{0}
+\tableofcontents
+\clearpage
+
+%\setcounter{page}{0}
+%\listoffigures 
+%\clearpage
+%\setcounter{page}{0}
+%\listoftables% possibly insert 'list of acronyms'
+%
+%   - create a chapter called List Of Acronyms (or whatever), which
+%     should contain all your acronym definitions, e.g. 
+%     \chapter{List Of Acronyms} 
+%   - the secnumdepth trickery is needed because acronyms are as a
+%     standard chapter and we are faking '\listofacronyms'
+%
+%\setcounter{secnumdepth}{-1}
+%\input{your acronym chapter's file name}
+%\setcounter{secnumdepth}{2}% setup page numbering, page counter, etc.
+\startpages%
+\begin{comment}
+The thesis starts here.
+
+To better organize things, create a new tex file for each chapter
+and input it below.
+
+Avoid using the å, ä, ö or <space> characters in referred names and
+underscores \_ in file names (may break hyperref).
+
+Good luck!
+\end{comment}
+
+\input{johdanto.tex}\input{toinenluku.tex}
+
+%\input{file_name_of_chapter_x}
+%\input{file_name_of_chapter_y}
+
+\begin{comment}
+The thesis main content ends here.
+\end{comment}
+\printbibliography
+\begin{comment}
+Don't include this if appendices are not present. On the other hand,
+without this call, the appendices don't look right.
+\end{comment}
+
+\appendices 
+
+\begin{comment}
+Create your appendix chapters with command \textbackslash appchapter\{some
+name\} instead of \textbackslash chapter\{some name\} for the automagic
+page counting to work!
+\end{comment}
+
+
+\appchapter{Liitedokumentti}
+
+Tässä esimerkki\pagebreak{}
+
+kaksisivuisesta liitteestä.
+
+\appchapter{Liitedokumentti 2}
+
+Tässä esimerkki\pagebreak{}
+
+toisesta kaksisivuisesta liitteestä.
+
+\begin{comment}
+main document ends here
+\end{comment}
+
+\end{document}
diff --git a/latex/thesis/itpackage.sty b/latex/thesis/itpackage.sty
deleted file mode 100644
index 69df5a4fb1db00bee14dc672745e1fc8fe01989f..0000000000000000000000000000000000000000
--- a/latex/thesis/itpackage.sty
+++ /dev/null
@@ -1,394 +0,0 @@
-%
-% Package to use with the gradu.tex template for masters thesis in
-% University of Turku Laboratory of Electronics and Information
-% Technology.
-%
-% Consult the file gradu.tex for some documentation
-%
-\NeedsTeXFormat{LaTeX2e}[1995/12/01]
-\ProvidesPackage{thesis/itpackage}[2016/9/21 v. 1.3 Sami Nuuttila samnuutt@utu.fi (minor additions by jjholv@utu.fi)]
-\typeout{itpackage.sty -- additional definitions for it-dept...}
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% handle things based on language
-%
-\newif\iffin
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% setup document appearance
-%
-
-% change default font to times-roman
-\renewcommand{\sfdefault}{phv}
-\renewcommand{\rmdefault}{ptm}
-\renewcommand{\ttdefault}{pcr}
-
-% fix page size
-%
-%  - page width: 
-%     1inch             +
-%      \hoffset         +
-%      \oddsidemargin   +
-%      \textwidth       +
-%      \marginsep       +
-%      \marginparwidth
-%
-%  - page height: 
-%     1inch             +
-%      \voffset         +
-%      \topmargin       +
-%      \headheight      +
-%      \headsep         +
-%      \textheight      +
-%      \footnotesep     +
-%      \footheigth 
-%
-%  - 1 pt == 1/72 inch == 0.35 mm
-%
-% page width... left margin 4cm, right 2cm
-%
-\setlength{\hoffset}{0mm}
-\setlength{\marginparsep}{0mm}
-\setlength{\marginparwidth}{0mm}
-\setlength{\textwidth}{\paperwidth}
-\addtolength\textwidth{-60 mm}
-\setlength{\oddsidemargin}{-1 in}
-\addtolength\oddsidemargin{40 mm}
-%
-% page height... textheight starts at ~4cm from top, 
-% i.e. 1 in + 12 pt + 24 pt = 1.5 in 
-%
-\setlength{\voffset}{0 mm}
-\setlength{\topmargin}{0 mm}
-\setlength{\headheight}{12 pt}
-\setlength{\headsep}{24 pt}
-\setlength{\textheight}{230mm}
-\setlength{\footnotesep}{12 pt}
-
- 
-% setup linespacings to suit to the (stupid) requirement of double spacing
-%
-% - fake 1.5 linespacing
-%    \renewcommand{\baselinestretch}{1.241}
-%
-% - fake 2 linespacing
-%
-\renewcommand{\baselinestretch}{1.655}
-
-% local temporary width
-% 
-\newlength{\etttmpwidth}
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% provide the entry environment
-%
-
-\newenvironment{entry}[1]
-{\begin{list}{}{%
-      \renewcommand{\makelabel}[1]{\textrm{##1:}\hfil}%
-      \settowidth{\labelwidth}{\textrm{#1:}}%
-      \setlength{\leftmargin}{\labelwidth}%
-      \addtolength{\leftmargin}{\labelsep}}}
-{\end{list}}
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% 
-% define \figcaption and \tblcaption for use with non-floating figures and 
-% tables
-%
-
-\makeatletter
-  \newcommand\figcaption{\def\@captype{figure}\caption}
-  \newcommand\tblcaption{\def\@captype{table}\caption}
-\makeatother
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% 
-% define \workinfo which collects various bits of info for later use
-%
-\newcommand{\workinfo}[7]{
-        \newsavebox{\eauthor}
-        \sbox{\eauthor}{#1}
-        \newsavebox{\esauthor}
-        \sbox{\esauthor}{\textsc{#1}}
-        \newsavebox{\etitle}
-        \newlength{\authorwidth}
-        \setlength{\etttmpwidth}{\linewidth}
-        \renewcommand{\baselinestretch}{1}\normalsize
-        \settowidth{\authorwidth}{\textsc{#1:\space}}
-        \addtolength{\etttmpwidth}{-\authorwidth}
-        \sbox{\etitle}{\parbox[t]{\etttmpwidth}{#2}}
-        \renewcommand{\baselinestretch}{1.655}\normalsize
-        \newsavebox{\ehtitle}
-        \sbox{\ehtitle}{\parbox[b]{\linewidth}{\flushright\Huge{#2}}}
-        \newsavebox{\erevrone}
-        \sbox{\erevrone}{#3}
-        \newsavebox{\erevrtwo}
-        \sbox{\erevrtwo}{#4}
-        \newsavebox{\eyear}
-        \sbox{\eyear}{#5}
-        \newsavebox{\emonth}
-        \sbox{\emonth}{#6}
-        \newsavebox{\emonthfi}
-        \sbox{\emonthfi}{#7}
-}
-
-\newcommand{\worktype}[2]{
-  \newsavebox{\wt}\sbox{\wt}{#1}
-  \newsavebox{\wtfi}\sbox{\wtfi}{#2}
-}
-
-\newcommand{\deptinfo}[2]{
-  \newsavebox{\di}\sbox{\di}{#1}
-  \newsavebox{\difi}\sbox{\difi}{#2}
-}
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% 
-% define the \gentitle command
-%
-\newcommand{\gentitle}{%
-\clearpage 
-\thispagestyle{empty}
-\vspace*{\stretch{1}}
-\noindent 
-\rule{\linewidth}{1 mm}
-\begin{flushright}
-\usebox{\ehtitle}
-\end{flushright}
-\rule{\linewidth}{1 mm}
-\vspace*{\stretch{4}}
-\\
-\renewcommand{\baselinestretch}{1}\normalsize
- \iffin
- \begin{tabular}{p{80 mm}p{70 mm}}           \\
- &
- \usebox{\wtfi}                              \\
- & Turun yliopisto                           \\
- & Tulevaisuuden teknologioiden laitos       \\
- \else
-\begin{tabular}{p{78 mm}p{72 mm}}            \\
- & \usebox{\wt}                              \\
- & University of Turku                       \\
- & Department of Future Technologies         \\
- \fi
- & \iffin
- \usebox{\difi}                              \\
- \else
- \usebox{\di}                                \\
- \fi
- & \usebox{\eyear}                           \\
- & \usebox{\eauthor}                         \\
- &                                           \\
- % JH: Supervisors generally not stated as part of
- % the thesis at IT / TT Dept. Uncomment below to show
- %\iffin
- %& Tarkastajat:                              \\ 
- %\else
- %& Supervisors:                              \\
- %\fi
- %& \hspace*{4 ex} \usebox{\erevrone}         \\
- %& \hspace*{4 ex} \usebox{\erevrtwo}         \\[4ex]
-\end{tabular}
-\vspace*{\stretch{1}}\\
-\begin{minipage}[b]{\textwidth}
-\iffin
-\scriptsize Turun yliopiston laatujärjestelmän mukaisesti tämän julkaisun alkuperäisyys on tarkastettu Turnitin OriginalityCheck-järjestelmällä.
-\else
-\scriptsize The originality of this thesis has been checked in
-accordance with the University of Turku quality assurance system using
-the Turnitin OriginalityCheck service. 
-\fi
-\end{minipage}
-\renewcommand{\baselinestretch}{1.655}\normalsize
-\clearpage
-}
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% define itabstract environment for abstract page
-%
-\newenvironment{itabstract}[1]{%
-\selectlanguage{english}
-\newsavebox{\keywords}
-\newlength{\keywordswidth}
-\settowidth{\keywordswidth}{\textrm{Keywords:}}
-\setlength{\etttmpwidth}{\linewidth}
-\addtolength{\etttmpwidth}{-\keywordswidth}
-\addtolength{\etttmpwidth}{-\labelsep}
-\addtolength{\etttmpwidth}{-1mm}
-\sbox{\keywords}{\parbox[t]{\etttmpwidth}{#1}}
-\setlength{\headheight}{0 pt}
-\setlength{\headsep}{0 pt}
-\addtolength\topmargin{-1 in}
-\addtolength\topmargin{2.0 cm}
-\renewcommand{\baselinestretch}{1}\normalsize
-\clearpage
-\thispagestyle{empty}
-\noindent
-\begin{minipage}[\textheight]{\linewidth}
-UNIVERSITY OF TURKU\\
-Department of Future Technologies
-\begin{entry}{\usebox{\eauthor}}
-\item[\usebox{\esauthor}] \usebox{\etitle}
-\end{entry}
-
-\usebox{\wt}, \pageref{endofpages} p., \pageref{endofappendices} app. p. \\
-\usebox{\di}\\
-\usebox{\emonth} \usebox{\eyear} \\
-\rule{\linewidth}{1 pt}
-\\
-}
-{
-\bigskip
-\\
-\begin{entry}{Keywords}
-\item[Keywords] \usebox{\keywords}
-\end{entry}
-\end{minipage}
-\clearpage
-\setcounter{page}{0}
-\setlength{\headheight}{12 pt}
-\setlength{\headsep}{24 pt}
-\setlength{\topmargin}{0 mm}
-\renewcommand{\baselinestretch}{1.655}\normalsize
-}
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% define ittiivis environment for tiivistelmäsivu ;-)
-%
-\newenvironment{ittiivis}[1]{%
-\selectlanguage{finnish}
-\newsavebox{\asiasanat}
-\newlength{\asiasanatwidth}
-\settowidth{\asiasanatwidth}{\textrm{Asiasanat:}}
-\setlength{\etttmpwidth}{\linewidth}
-\addtolength{\etttmpwidth}{-\asiasanatwidth}
-\addtolength{\etttmpwidth}{-\labelsep}
-\addtolength{\etttmpwidth}{-1mm}
-\sbox{\asiasanat}{\parbox[t]{\etttmpwidth}{#1}}
-\setlength{\headheight}{0 pt}
-\setlength{\headsep}{0 pt}
-\addtolength\topmargin{-1 in}
-\addtolength\topmargin{2.0 cm}
-\renewcommand{\baselinestretch}{1}\normalsize
-\clearpage
-\thispagestyle{empty}
-\noindent
-\begin{minipage}[\textheight]{\linewidth}
-TURUN YLIOPISTO\\
-Tulevaisuuden teknologioiden laitos
-\begin{entry}{\usebox{\eauthor}}
-\item[\usebox{\esauthor}] \usebox{\etitle}
-\end{entry}
-
-\usebox{\wtfi}, \pageref{endofpages} s., \pageref{endofappendices} liites. \\
-\usebox{\difi}\\
-\usebox{\emonthfi} \usebox{\eyear} \\
-\rule{\linewidth}{1 pt}
-\\
-}
-{
-\bigskip
-\\
-\begin{entry}{Asiasanat}
-\item[Asiasanat] \usebox{\asiasanat}
-\end{entry}
-\end{minipage}
-\clearpage
-\setcounter{page}{0}
-\setlength{\headheight}{12 pt}
-\setlength{\headsep}{24 pt}
-\setlength{\topmargin}{0 mm}
-\renewcommand{\baselinestretch}{1.655}\normalsize
-}
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% define \startpages
-%
-\newcommand{\startpages}{%
-        \clearpage
-        \pagenumbering{arabic}
-        \setcounter{page}{1}
-        \renewcommand{\baselinestretch}{1.655}
-
-        \pagestyle{fancy}
-        \renewcommand{\chaptermark}[1]{
-          \markboth{
-            \MakeUppercase{\chaptername\ \thechapter.\ ##1}}
-          {}
-        }
-        \lhead{\leftmark}
-        \chead{}
-        \rhead{\thepage}
-        \fancyfoot{}
-}       
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% define \eofpages 
-%
-\makeatletter
-\def\eof@pages{%
-        \immediate\write\@auxout{\string
-        \newlabel{endofpages}{{}{\arabic{page}}}}%
-}
-\newcommand{\eofpages}{\eof@pages}
-\makeatother
-
-%
-% 
-%
-\newcommand{\appname}{foo}
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% define \appendices
-%
-\newcommand{\appendices}{%
-  \addtocontents{toc}{\protect\contentsline{chapter}{\appname}{}\relax}
-  \newpage
-  \appendix
-  \renewcommand{\chaptermark}[1]{\markboth{\MakeUppercase{\appendixname\ \thechapter.\ ##1}}{}}
-  \lhead{\leftmark}
-  \chead{}
-  \rhead{\thepage}
-  \fancyfoot{}
-  \renewcommand{\thepage}{\thechapter-\arabic{page}}
-  \setcounter{page}{1}
-}
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% define \appchapter
-%
-\newcounter{apppage}
-\setcounter{apppage}{0}
-\newcommand{\appchapter}[1]{%
-        \addtocounter{apppage}{\value{page}}
-        \clearpage
-        \setcounter{page}{1}
-        \chapter{#1}
-}
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% define \eofapppages
-%
-\makeatletter
-\def\eof@apppages{%
-        \immediate\write\@auxout{\string
-        \newlabel{endofappendices}{{}{\arabic{apppage}}}}%
-}
-\newcommand{\eofapppages}{%
-        \addtocounter{apppage}{\value{page}}
-        \addtocounter{apppage}{-1}
-        \eof@apppages
-}
-\makeatother
diff --git a/latex/thesis/unsrtf.bst b/latex/thesis/unsrtf.bst
deleted file mode 100644
index 189f652b98d2cebcf5c1608c56645e65ba886737..0000000000000000000000000000000000000000
--- a/latex/thesis/unsrtf.bst
+++ /dev/null
@@ -1,1316 +0,0 @@
-%%
-%% This is file `unsrtf.bst',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% merlin.mbs  (with options: `head,exlang,seq-no,vonx,ed-au,nmlm,x3,m3,atit-u,num-xser,isbn,issn,finnish,pp,ed,ord,and-xcom,url,url-nt,{}')
-%% finnish.mbs  (with options: `exlang,seq-no,vonx,ed-au,nmlm,x3,m3,atit-u,num-xser,isbn,issn,finnish,pp,ed,ord,and-xcom,url,url-nt,{}')
-%% merlin.mbs  (with options: `tail,exlang,seq-no,vonx,ed-au,nmlm,x3,m3,atit-u,num-xser,isbn,issn,finnish,pp,ed,ord,and-xcom,url,url-nt,{}')
-%% ----------------------------------------
-%% *** suomi testi ***
-%% 
-%% Copyright 1994-2002 Patrick W Daly
- % ===============================================================
- % IMPORTANT NOTICE:
- % This bibliographic style (bst) file has been generated from one or
- % more master bibliographic style (mbs) files, listed above.
- %
- % This generated file can be redistributed and/or modified under the terms
- % of the LaTeX Project Public License Distributed from CTAN
- % archives in directory macros/latex/base/lppl.txt; either
- % version 1 of the License, or any later version.
- % ===============================================================
- % Name and version information of the main mbs file:
- % \ProvidesFile{merlin.mbs}[2002/10/21 4.05 (PWD, AO, DPC)]
- %   For use with BibTeX version 0.99a or later
- %-------------------------------------------------------------------
- % This bibliography style file is intended for texts in
- %   FINNISH
- % This is a numerical citation style, and as such is standard LaTeX.
- % It requires no extra package to interface to the main text.
- % The form of the \bibitem entries is
- %   \bibitem{key}...
- % Usage of \cite is as follows:
- %   \cite{key} ==>>          [#]
- %   \cite[chap. 2]{key} ==>> [#, chap. 2]
- % where # is a number determined by the ordering in the reference list.
- % The order in the reference list is that by which the works were originally
- %   cited in the text, or that in the database.
- %---------------------------------------------------------------------
-
-ENTRY
-  { address
-    author
-    booktitle
-    chapter
-    edition
-    editor
-    howpublished
-    institution
-    isbn
-    issn
-    journal
-    key
-    month
-    note
-    number
-    organization
-    pages
-    publisher
-    school
-    series
-    title
-    type
-    url
-    volume
-    year
-  }
-  {}
-  { label }
-INTEGERS { output.state before.all mid.sentence after.sentence after.block }
-FUNCTION {init.state.consts}
-{ #0 'before.all :=
-  #1 'mid.sentence :=
-  #2 'after.sentence :=
-  #3 'after.block :=
-}
-STRINGS { s t}
-FUNCTION {output.nonnull}
-{ 's :=
-  output.state mid.sentence =
-    { ", " * write$ }
-    { output.state after.block =
-        { add.period$ write$
-          newline$
-          "\newblock " write$
-        }
-        { output.state before.all =
-            'write$
-            { add.period$ " " * write$ }
-          if$
-        }
-      if$
-      mid.sentence 'output.state :=
-    }
-  if$
-  s
-}
-FUNCTION {output}
-{ duplicate$ empty$
-    'pop$
-    'output.nonnull
-  if$
-}
-FUNCTION {output.check}
-{ 't :=
-  duplicate$ empty$
-    { pop$ "empty " t * " in " * cite$ * warning$ }
-    'output.nonnull
-  if$
-}
-FUNCTION {fin.entry}
-{ add.period$
-  write$
-  newline$
-}
-
-FUNCTION {new.block}
-{ output.state before.all =
-    'skip$
-    { after.block 'output.state := }
-  if$
-}
-FUNCTION {new.sentence}
-{ output.state after.block =
-    'skip$
-    { output.state before.all =
-        'skip$
-        { after.sentence 'output.state := }
-      if$
-    }
-  if$
-}
-FUNCTION {add.blank}
-{  " " * before.all 'output.state :=
-}
-
-FUNCTION {date.block}
-{
-  new.block
-}
-
-FUNCTION {not}
-{   { #0 }
-    { #1 }
-  if$
-}
-FUNCTION {and}
-{   'skip$
-    { pop$ #0 }
-  if$
-}
-FUNCTION {or}
-{   { pop$ #1 }
-    'skip$
-  if$
-}
-FUNCTION {new.block.checka}
-{ empty$
-    'skip$
-    'new.block
-  if$
-}
-FUNCTION {new.block.checkb}
-{ empty$
-  swap$ empty$
-  and
-    'skip$
-    'new.block
-  if$
-}
-FUNCTION {new.sentence.checka}
-{ empty$
-    'skip$
-    'new.sentence
-  if$
-}
-FUNCTION {new.sentence.checkb}
-{ empty$
-  swap$ empty$
-  and
-    'skip$
-    'new.sentence
-  if$
-}
-FUNCTION {field.or.null}
-{ duplicate$ empty$
-    { pop$ "" }
-    'skip$
-  if$
-}
-FUNCTION {emphasize}
-{ duplicate$ empty$
-    { pop$ "" }
-    { "{\em " swap$ * "\/}" * }
-  if$
-}
-FUNCTION {tie.or.space.prefix}
-{ duplicate$ text.length$ #3 <
-    { "~" }
-    { " " }
-  if$
-  swap$
-}
-
-FUNCTION {capitalize}
-{ "u" change.case$ "t" change.case$ }
-
-FUNCTION {space.word}
-{ " " swap$ * " " * }
- % Here are the language-specific definitions for explicit words.
- % Each function has a name bbl.xxx where xxx is the English word.
- %-------------------------------------------------------------------
- % Begin module:
- % \ProvidesFile{finnish.mbs}[2002/10/18 4.0a (PWD)]
-
-
- % The language selected here is FINNISH
-FUNCTION {bbl.and}
-{ "ja"}
-
-FUNCTION {bbl.etal}
-{ "et~al." }
-
-FUNCTION {bbl.editors}
-{ "toim." }
-
-FUNCTION {bbl.editor}
-{ "toim." }
-
-FUNCTION {bbl.edby}
-{ "toimittanut" }
-
-FUNCTION {bbl.edition}
-{ "painos" }
-
-FUNCTION {bbl.volume}
-{ "osa" }
-
-FUNCTION {bbl.of}
-{ "sarjasta" }
-
-FUNCTION {bbl.number}
-{ "numero" }
-
-FUNCTION {bbl.nr}
-{ "no." }
-
-FUNCTION {bbl.in}
-{ "teoksessa" }
-
-FUNCTION {bbl.pages}
-{ "ss." }
-
-FUNCTION {bbl.page}
-{ "s." }
-
-FUNCTION {bbl.chapter}
-{ "luku" }
-
-FUNCTION {bbl.techrep}
-{ "Tekninen Raportti" }
-
-FUNCTION {bbl.mthesis}
-{ "pro gradu" }
-
-FUNCTION {bbl.phdthesis}
-{ "v\^^b{a}it\^^b{o}skirja" }
-
-FUNCTION {bbl.first}
-{ "1." }
-
-FUNCTION {bbl.second}
-{ "2." }
-
-FUNCTION {bbl.third}
-{ "3." }
-
-FUNCTION {bbl.fourth}
-{ "4." }
-
-FUNCTION {bbl.fifth}
-{ "5." }
-
-FUNCTION {bbl.st}
-{ "." }
-
-FUNCTION {bbl.nd}
-{ "." }
-
-FUNCTION {bbl.rd}
-{ "." }
-
-FUNCTION {bbl.th}
-{ "." }
-
-MACRO {jan} {"tammikuu"}
-
-MACRO {feb} {"helmikuu"}
-
-MACRO {mar} {"maaliskuu"}
-
-MACRO {apr} {"huhtikuu"}
-
-MACRO {may} {"toukokuu"}
-
-MACRO {jun} {"kes\^^b{a}kuu"}
-
-MACRO {jul} {"hein\^^b{a}kuu"}
-
-MACRO {aug} {"elokuu"}
-
-MACRO {sep} {"syyskuu"}
-
-MACRO {oct} {"lokakuu"}
-
-MACRO {nov} {"marraskuu"}
-
-MACRO {dec} {"joulukuu"}
-
- % End module: finnish.mbs
-%% Copyright 1994-2002 Patrick W Daly
-MACRO {acmcs} {"ACM Computing Surveys"}
-
-MACRO {acta} {"Acta Informatica"}
-
-MACRO {cacm} {"Communications of the ACM"}
-
-MACRO {ibmjrd} {"IBM Journal of Research and Development"}
-
-MACRO {ibmsj} {"IBM Systems Journal"}
-
-MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
-
-MACRO {ieeetc} {"IEEE Transactions on Computers"}
-
-MACRO {ieeetcad}
- {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
-
-MACRO {ipl} {"Information Processing Letters"}
-
-MACRO {jacm} {"Journal of the ACM"}
-
-MACRO {jcss} {"Journal of Computer and System Sciences"}
-
-MACRO {scp} {"Science of Computer Programming"}
-
-MACRO {sicomp} {"SIAM Journal on Computing"}
-
-MACRO {tocs} {"ACM Transactions on Computer Systems"}
-
-MACRO {tods} {"ACM Transactions on Database Systems"}
-
-MACRO {tog} {"ACM Transactions on Graphics"}
-
-MACRO {toms} {"ACM Transactions on Mathematical Software"}
-
-MACRO {toois} {"ACM Transactions on Office Information Systems"}
-
-MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
-
-MACRO {tcs} {"Theoretical Computer Science"}
-FUNCTION {bibinfo.check}
-{ swap$
-  duplicate$ missing$
-    {
-      pop$ pop$
-      ""
-    }
-    { duplicate$ empty$
-        {
-          swap$ pop$
-        }
-        { swap$
-          pop$
-        }
-      if$
-    }
-  if$
-}
-FUNCTION {bibinfo.warn}
-{ swap$
-  duplicate$ missing$
-    {
-      swap$ "missing " swap$ * " in " * cite$ * warning$ pop$
-      ""
-    }
-    { duplicate$ empty$
-        {
-          swap$ "empty " swap$ * " in " * cite$ * warning$
-        }
-        { swap$
-          pop$
-        }
-      if$
-    }
-  if$
-}
-STRINGS  { bibinfo}
-INTEGERS { nameptr namesleft numnames }
-
-FUNCTION {format.names}
-{ 'bibinfo :=
-  duplicate$ empty$ 'skip$ {
-  's :=
-  "" 't :=
-  #1 'nameptr :=
-  s num.names$ 'numnames :=
-  numnames 'namesleft :=
-    { namesleft #0 > }
-    { s nameptr
-      "{ff~}{vv~}{ll}{, jj}"
-      format.name$
-      bibinfo bibinfo.check
-      't :=
-      nameptr #1 >
-        {
-          nameptr #3
-          #1 + =
-          numnames #3
-          > and
-            { "others" 't :=
-              #1 'namesleft := }
-            'skip$
-          if$
-          namesleft #1 >
-            { ", " * t * }
-            {
-              s nameptr "{ll}" format.name$ duplicate$ "others" =
-                { 't := }
-                { pop$ }
-              if$
-              t "others" =
-                {
-                  " " * bbl.etal *
-                }
-                {
-                  bbl.and
-                  space.word * t *
-                }
-              if$
-            }
-          if$
-        }
-        't
-      if$
-      nameptr #1 + 'nameptr :=
-      namesleft #1 - 'namesleft :=
-    }
-  while$
-  } if$
-}
-FUNCTION {format.names.ed}
-{
-  format.names
-}
-FUNCTION {format.authors}
-{ author "author" format.names
-}
-FUNCTION {get.bbl.editor}
-{ editor num.names$ #1 > 'bbl.editors 'bbl.editor if$ }
-
-FUNCTION {format.editors}
-{ editor "editor" format.names duplicate$ empty$ 'skip$
-    {
-      "," *
-      " " *
-      get.bbl.editor
-      *
-    }
-  if$
-}
-FUNCTION {format.isbn}
-{ isbn "isbn" bibinfo.check
-  duplicate$ empty$ 'skip$
-    {
-      new.block
-      "ISBN " swap$ *
-    }
-  if$
-}
-
-FUNCTION {format.issn}
-{ issn "issn" bibinfo.check
-  duplicate$ empty$ 'skip$
-    {
-      new.block
-      "ISSN " swap$ *
-    }
-  if$
-}
-
-FUNCTION {format.note}
-{
-  url empty$
-    'skip$
-    { "\urlprefix\url{" url * "}" * output }
-  if$
- note empty$
-    { "" }
-    { note #1 #1 substring$
-      duplicate$ "{" =
-        'skip$
-        { output.state mid.sentence =
-          { "l" }
-          { "u" }
-        if$
-        change.case$
-        }
-      if$
-      note #2 global.max$ substring$ * "note" bibinfo.check
-    }
-  if$
-}
-
-FUNCTION {format.title}
-{ title
-  "title" bibinfo.check
-}
-FUNCTION {output.bibitem}
-{ newline$
-  "\bibitem{" write$
-  cite$ write$
-  "}" write$
-  newline$
-  ""
-  before.all 'output.state :=
-}
-
-FUNCTION {n.dashify}
-{
-  't :=
-  ""
-    { t empty$ not }
-    { t #1 #1 substring$ "-" =
-        { t #1 #2 substring$ "--" = not
-            { "--" *
-              t #2 global.max$ substring$ 't :=
-            }
-            {   { t #1 #1 substring$ "-" = }
-                { "-" *
-                  t #2 global.max$ substring$ 't :=
-                }
-              while$
-            }
-          if$
-        }
-        { t #1 #1 substring$ *
-          t #2 global.max$ substring$ 't :=
-        }
-      if$
-    }
-  while$
-}
-
-FUNCTION {word.in}
-{ bbl.in capitalize
-  " " * }
-
-FUNCTION {format.date}
-{
-  month "month" bibinfo.check
-  duplicate$ empty$
-  year  "year"  bibinfo.check duplicate$ empty$
-    { swap$ 'skip$
-        { "there's a month but no year in " cite$ * warning$ }
-      if$
-      *
-    }
-    { swap$ 'skip$
-        {
-          swap$
-          " " * swap$
-        }
-      if$
-      *
-    }
-  if$
-}
-FUNCTION {format.btitle}
-{ title "title" bibinfo.check
-  duplicate$ empty$ 'skip$
-    {
-      emphasize
-    }
-  if$
-}
-FUNCTION {either.or.check}
-{ empty$
-    'pop$
-    { "can't use both " swap$ * " fields in " * cite$ * warning$ }
-  if$
-}
-FUNCTION {format.bvolume}
-{ volume empty$
-    { "" }
-    { bbl.volume volume tie.or.space.prefix
-      "volume" bibinfo.check * *
-      series "series" bibinfo.check
-      duplicate$ empty$ 'pop$
-        { swap$ bbl.of space.word * swap$
-          emphasize * }
-      if$
-      "volume and number" number either.or.check
-    }
-  if$
-}
-FUNCTION {format.number.series}
-{ volume empty$
-    { number empty$
-        { series field.or.null }
-        { series empty$
-            { number "number" bibinfo.check }
-        { output.state mid.sentence =
-            { bbl.number }
-            { bbl.number capitalize }
-          if$
-          number tie.or.space.prefix "number" bibinfo.check * *
-          bbl.in space.word *
-          series "series" bibinfo.check *
-        }
-      if$
-    }
-      if$
-    }
-    { "" }
-  if$
-}
-FUNCTION {is.num}
-{ chr.to.int$
-  duplicate$ "0" chr.to.int$ < not
-  swap$ "9" chr.to.int$ > not and
-}
-
-FUNCTION {extract.num}
-{ duplicate$ 't :=
-  "" 's :=
-  { t empty$ not }
-  { t #1 #1 substring$
-    t #2 global.max$ substring$ 't :=
-    duplicate$ is.num
-      { s swap$ * 's := }
-      { pop$ "" 't := }
-    if$
-  }
-  while$
-  s empty$
-    'skip$
-    { pop$ s }
-  if$
-}
-
-FUNCTION {convert.edition}
-{ extract.num "l" change.case$ 's :=
-  s "first" = s "1" = or
-    { bbl.first 't := }
-    { s "second" = s "2" = or
-        { bbl.second 't := }
-        { s "third" = s "3" = or
-            { bbl.third 't := }
-            { s "fourth" = s "4" = or
-                { bbl.fourth 't := }
-                { s "fifth" = s "5" = or
-                    { bbl.fifth 't := }
-                    { s #1 #1 substring$ is.num
-                        { s bbl.th * 't := }
-                        { edition 't := }
-                      if$
-                    }
-                  if$
-                }
-              if$
-            }
-          if$
-        }
-      if$
-    }
-  if$
-  t
-}
-
-FUNCTION {format.edition}
-{ edition duplicate$ empty$ 'skip$
-    {
-      convert.edition
-      output.state mid.sentence =
-        { "l" }
-        { "t" }
-      if$ change.case$
-      "edition" bibinfo.check
-      " " * bbl.edition *
-    }
-  if$
-}
-INTEGERS { multiresult }
-FUNCTION {multi.page.check}
-{ 't :=
-  #0 'multiresult :=
-    { multiresult not
-      t empty$ not
-      and
-    }
-    { t #1 #1 substring$
-      duplicate$ "-" =
-      swap$ duplicate$ "," =
-      swap$ "+" =
-      or or
-        { #1 'multiresult := }
-        { t #2 global.max$ substring$ 't := }
-      if$
-    }
-  while$
-  multiresult
-}
-FUNCTION {format.pages}
-{ pages duplicate$ empty$ 'skip$
-    { duplicate$ multi.page.check
-        {
-          bbl.pages swap$
-          n.dashify
-        }
-        {
-          bbl.page swap$
-        }
-      if$
-      tie.or.space.prefix
-      "pages" bibinfo.check
-      * *
-    }
-  if$
-}
-FUNCTION {format.journal.pages}
-{ pages duplicate$ empty$ 'pop$
-    { swap$ duplicate$ empty$
-        { pop$ pop$ format.pages }
-        {
-          ":" *
-          swap$
-          n.dashify
-          "pages" bibinfo.check
-          *
-        }
-      if$
-    }
-  if$
-}
-FUNCTION {format.vol.num.pages}
-{ volume field.or.null
-  duplicate$ empty$ 'skip$
-    {
-      "volume" bibinfo.check
-    }
-  if$
-  number "number" bibinfo.check duplicate$ empty$ 'skip$
-    {
-      swap$ duplicate$ empty$
-        { "there's a number but no volume in " cite$ * warning$ }
-        'skip$
-      if$
-      swap$
-      "(" swap$ * ")" *
-    }
-  if$ *
-  format.journal.pages
-}
-
-FUNCTION {format.chapter.pages}
-{ chapter empty$
-    'format.pages
-    { type empty$
-        { bbl.chapter }
-        { type "l" change.case$
-          "type" bibinfo.check
-        }
-      if$
-      chapter tie.or.space.prefix
-      "chapter" bibinfo.check
-      * *
-      pages empty$
-        'skip$
-        { ", " * format.pages * }
-      if$
-    }
-  if$
-}
-
-FUNCTION {format.booktitle}
-{
-  booktitle "booktitle" bibinfo.check
-  emphasize
-}
-FUNCTION {format.in.ed.booktitle}
-{ format.booktitle duplicate$ empty$ 'skip$
-    {
-      editor "editor" format.names.ed duplicate$ empty$ 'pop$
-        {
-          "," *
-          " " *
-          get.bbl.editor
-          ", " *
-          * swap$
-          * }
-      if$
-      word.in swap$ *
-    }
-  if$
-}
-FUNCTION {empty.misc.check}
-{ author empty$ title empty$ howpublished empty$
-  month empty$ year empty$ note empty$
-  and and and and and
-    { "all relevant fields are empty in " cite$ * warning$ }
-    'skip$
-  if$
-}
-FUNCTION {format.thesis.type}
-{ type duplicate$ empty$
-    'pop$
-    { swap$ pop$
-      "t" change.case$ "type" bibinfo.check
-    }
-  if$
-}
-FUNCTION {format.tr.number}
-{ number "number" bibinfo.check
-  type duplicate$ empty$
-    { pop$ bbl.techrep }
-    'skip$
-  if$
-  "type" bibinfo.check
-  swap$ duplicate$ empty$
-    { pop$ "t" change.case$ }
-    { tie.or.space.prefix * * }
-  if$
-}
-FUNCTION {format.article.crossref}
-{
-  key duplicate$ empty$
-    { pop$
-      journal duplicate$ empty$
-        { "need key or journal for " cite$ * " to crossref " * crossref * warning$ }
-        { "journal" bibinfo.check emphasize word.in swap$ * }
-      if$
-    }
-    { word.in swap$ * " " *}
-  if$
-  " \cite{" * crossref * "}" *
-}
-FUNCTION {format.crossref.editor}
-{ editor #1 "{vv~}{ll}" format.name$
-  "editor" bibinfo.check
-  editor num.names$ duplicate$
-  #2 >
-    { pop$
-      "editor" bibinfo.check
-      " " * bbl.etal
-      *
-    }
-    { #2 <
-        'skip$
-        { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
-            {
-              "editor" bibinfo.check
-              " " * bbl.etal
-              *
-            }
-            {
-             bbl.and space.word
-              * editor #2 "{vv~}{ll}" format.name$
-              "editor" bibinfo.check
-              *
-            }
-          if$
-        }
-      if$
-    }
-  if$
-}
-FUNCTION {format.book.crossref}
-{ volume duplicate$ empty$
-    { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
-      pop$ word.in
-    }
-    { bbl.volume
-      capitalize
-      swap$ tie.or.space.prefix "volume" bibinfo.check * * bbl.of space.word *
-    }
-  if$
-  editor empty$
-  editor field.or.null author field.or.null =
-  or
-    { key empty$
-        { series empty$
-            { "need editor, key, or series for " cite$ * " to crossref " *
-              crossref * warning$
-              "" *
-            }
-            { series emphasize * }
-          if$
-        }
-        { key * }
-      if$
-    }
-    { format.crossref.editor * }
-  if$
-  " \cite{" * crossref * "}" *
-}
-FUNCTION {format.incoll.inproc.crossref}
-{
-  editor empty$
-  editor field.or.null author field.or.null =
-  or
-    { key empty$
-        { format.booktitle duplicate$ empty$
-            { "need editor, key, or booktitle for " cite$ * " to crossref " *
-              crossref * warning$
-            }
-            { word.in swap$ * }
-          if$
-        }
-        { word.in key * " " *}
-      if$
-    }
-    { word.in format.crossref.editor * " " *}
-  if$
-  " \cite{" * crossref * "}" *
-}
-FUNCTION {format.org.or.pub}
-{ 't :=
-  ""
-  address empty$ t empty$ and
-    'skip$
-    {
-      t empty$
-        { address "address" bibinfo.check *
-        }
-        { t *
-          address empty$
-            'skip$
-            { ", " * address "address" bibinfo.check * }
-          if$
-        }
-      if$
-    }
-  if$
-}
-FUNCTION {format.publisher.address}
-{ publisher "publisher" bibinfo.warn format.org.or.pub
-}
-
-FUNCTION {format.organization.address}
-{ organization "organization" bibinfo.check format.org.or.pub
-}
-
-FUNCTION {article}
-{ output.bibitem
-  format.authors "author" output.check
-  new.block
-  format.title "title" output.check
-  new.block
-  crossref missing$
-    {
-      journal
-      "journal" bibinfo.check
-      emphasize
-      "journal" output.check
-      format.vol.num.pages output
-      format.date "year" output.check
-    }
-    { format.article.crossref output.nonnull
-      format.pages output
-    }
-  if$
-  format.issn output
-  new.block
-  format.note output
-  fin.entry
-}
-FUNCTION {book}
-{ output.bibitem
-  author empty$
-    { format.editors "author and editor" output.check
-    }
-    { format.authors output.nonnull
-      crossref missing$
-        { "author and editor" editor either.or.check }
-        'skip$
-      if$
-    }
-  if$
-  new.block
-  format.btitle "title" output.check
-  crossref missing$
-    { format.bvolume output
-      new.block
-      format.number.series output
-      new.sentence
-      format.publisher.address output
-    }
-    {
-      new.block
-      format.book.crossref output.nonnull
-    }
-  if$
-  format.edition output
-  format.date "year" output.check
-  format.isbn output
-  new.block
-  format.note output
-  fin.entry
-}
-FUNCTION {booklet}
-{ output.bibitem
-  format.authors output
-  new.block
-  format.title "title" output.check
-  new.block
-  howpublished "howpublished" bibinfo.check output
-  address "address" bibinfo.check output
-  format.date output
-  format.isbn output
-  new.block
-  format.note output
-  fin.entry
-}
-
-FUNCTION {inbook}
-{ output.bibitem
-  author empty$
-    { format.editors "author and editor" output.check
-    }
-    { format.authors output.nonnull
-      crossref missing$
-        { "author and editor" editor either.or.check }
-        'skip$
-      if$
-    }
-  if$
-  new.block
-  format.btitle "title" output.check
-  crossref missing$
-    {
-      format.bvolume output
-      format.chapter.pages "chapter and pages" output.check
-      new.block
-      format.number.series output
-      new.sentence
-      format.publisher.address output
-    }
-    {
-      format.chapter.pages "chapter and pages" output.check
-      new.block
-      format.book.crossref output.nonnull
-    }
-  if$
-  format.edition output
-  format.date "year" output.check
-  crossref missing$
-    { format.isbn output }
-    'skip$
-  if$
-  new.block
-  format.note output
-  fin.entry
-}
-
-FUNCTION {incollection}
-{ output.bibitem
-  format.authors "author" output.check
-  new.block
-  format.title "title" output.check
-  new.block
-  crossref missing$
-    { format.in.ed.booktitle "booktitle" output.check
-      format.bvolume output
-      format.number.series output
-      format.chapter.pages output
-      new.sentence
-      format.publisher.address output
-      format.edition output
-      format.date "year" output.check
-      format.isbn output
-    }
-    { format.incoll.inproc.crossref output.nonnull
-      format.chapter.pages output
-    }
-  if$
-  new.block
-  format.note output
-  fin.entry
-}
-FUNCTION {inproceedings}
-{ output.bibitem
-  format.authors "author" output.check
-  new.block
-  format.title "title" output.check
-  new.block
-  crossref missing$
-    { format.in.ed.booktitle "booktitle" output.check
-      format.bvolume output
-      format.number.series output
-      format.pages output
-      new.sentence
-      publisher empty$
-        { format.organization.address output }
-        { organization "organization" bibinfo.check output
-          format.publisher.address output
-        }
-      if$
-      format.date "year" output.check
-      format.isbn output
-      format.issn output
-    }
-    { format.incoll.inproc.crossref output.nonnull
-      format.pages output
-    }
-  if$
-  new.block
-  format.note output
-  fin.entry
-}
-FUNCTION {conference} { inproceedings }
-FUNCTION {manual}
-{ output.bibitem
-  author empty$
-    { organization "organization" bibinfo.check
-      duplicate$ empty$ 'pop$
-        { output
-          address "address" bibinfo.check output
-        }
-      if$
-    }
-    { format.authors output.nonnull }
-  if$
-  new.block
-  format.btitle "title" output.check
-  author empty$
-    { organization empty$
-        {
-          address new.block.checka
-          address "address" bibinfo.check output
-        }
-        'skip$
-      if$
-    }
-    {
-      organization address new.block.checkb
-      organization "organization" bibinfo.check output
-      address "address" bibinfo.check output
-    }
-  if$
-  format.edition output
-  format.date output
-  new.block
-  format.note output
-  fin.entry
-}
-
-FUNCTION {mastersthesis}
-{ output.bibitem
-  format.authors "author" output.check
-  new.block
-  format.btitle
-  "title" output.check
-  new.block
-  bbl.mthesis format.thesis.type output.nonnull
-  school "school" bibinfo.warn output
-  address "address" bibinfo.check output
-  format.date "year" output.check
-  new.block
-  format.note output
-  fin.entry
-}
-
-FUNCTION {misc}
-{ output.bibitem
-  format.authors output
-  title howpublished new.block.checkb
-  format.title output
-  howpublished new.block.checka
-  howpublished "howpublished" bibinfo.check output
-  format.date output
-  new.block
-  format.note output
-  fin.entry
-  empty.misc.check
-}
-FUNCTION {phdthesis}
-{ output.bibitem
-  format.authors "author" output.check
-  new.block
-  format.btitle
-  "title" output.check
-  new.block
-  bbl.phdthesis format.thesis.type output.nonnull
-  school "school" bibinfo.warn output
-  address "address" bibinfo.check output
-  format.date "year" output.check
-  new.block
-  format.note output
-  fin.entry
-}
-
-FUNCTION {proceedings}
-{ output.bibitem
-  editor empty$
-    { organization "organization" bibinfo.check output
-    }
-    { format.editors output.nonnull }
-  if$
-  new.block
-  format.btitle "title" output.check
-  format.bvolume output
-  format.number.series output
-  editor empty$
-    { publisher empty$
-        'skip$
-        {
-          new.sentence
-          format.publisher.address output
-        }
-      if$
-    }
-    { publisher empty$
-        {
-          new.sentence
-          format.organization.address output }
-        {
-          new.sentence
-          organization "organization" bibinfo.check output
-          format.publisher.address output
-        }
-      if$
-     }
-  if$
-      format.date "year" output.check
-  format.isbn output
-  format.issn output
-  new.block
-  format.note output
-  fin.entry
-}
-
-FUNCTION {techreport}
-{ output.bibitem
-  format.authors "author" output.check
-  new.block
-  format.title
-  "title" output.check
-  new.block
-  format.tr.number output.nonnull
-  institution "institution" bibinfo.warn output
-  address "address" bibinfo.check output
-  format.date "year" output.check
-  new.block
-  format.note output
-  fin.entry
-}
-
-FUNCTION {unpublished}
-{ output.bibitem
-  format.authors "author" output.check
-  new.block
-  format.title "title" output.check
-  format.date output
-  new.block
-  format.note "note" output.check
-  fin.entry
-}
-
-FUNCTION {default.type} { misc }
-READ
-STRINGS { longest.label }
-INTEGERS { number.label longest.label.width }
-FUNCTION {initialize.longest.label}
-{ "" 'longest.label :=
-  #1 'number.label :=
-  #0 'longest.label.width :=
-}
-FUNCTION {longest.label.pass}
-{ number.label int.to.str$ 'label :=
-  number.label #1 + 'number.label :=
-  label width$ longest.label.width >
-    { label 'longest.label :=
-      label width$ 'longest.label.width :=
-    }
-    'skip$
-  if$
-}
-EXECUTE {initialize.longest.label}
-ITERATE {longest.label.pass}
-FUNCTION {begin.bib}
-{ preamble$ empty$
-    'skip$
-    { preamble$ write$ newline$ }
-  if$
-  "\begin{thebibliography}{"  longest.label  * "}" *
-  write$ newline$
-  "\expandafter\ifx\csname url\endcsname\relax"
-  write$ newline$
-  "  \def\url#1{{\tt #1}}\fi"
-  write$ newline$
-  "\expandafter\ifx\csname urlprefix\endcsname\relax\def\urlprefix{URL }\fi"
-  write$ newline$
-}
-EXECUTE {begin.bib}
-EXECUTE {init.state.consts}
-ITERATE {call.type$}
-FUNCTION {end.bib}
-{ newline$
-  "\end{thebibliography}" write$ newline$
-}
-EXECUTE {end.bib}
-%% End of customized bst file
-%%
-%% End of file `unsrtf.bst'.
diff --git a/latex/toinenluku.lyx b/latex/toinenluku.lyx
new file mode 100644
index 0000000000000000000000000000000000000000..a54bfbb30b22363ca5c16c0577a75e3ed4b78f50
--- /dev/null
+++ b/latex/toinenluku.lyx
@@ -0,0 +1,119 @@
+#LyX 2.3 created this file. For more info see http://www.lyx.org/
+\lyxformat 544
+\begin_document
+\begin_header
+\save_transient_properties true
+\origin unavailable
+\textclass utuftthesis
+\use_default_options false
+\maintain_unincluded_children false
+\language finnish
+\language_package none
+\inputencoding utf8
+\fontencoding default
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
+\font_default_family default
+\use_non_tex_fonts true
+\font_sc false
+\font_osf false
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype false
+\use_dash_ligatures true
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\papersize default
+\use_geometry true
+\use_package amsmath 1
+\use_package amssymb 0
+\use_package cancel 0
+\use_package esint 1
+\use_package mathdots 0
+\use_package mathtools 0
+\use_package mhchem 0
+\use_package stackrel 0
+\use_package stmaryrd 0
+\use_package undertilde 0
+\cite_engine biblatex
+\cite_engine_type default
+\biblio_style plain
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 0
+\use_minted 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\paragraph_indentation default
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style swedish
+\dynamic_quotes 0
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tracking_changes false
+\output_changes false
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\end_header
+
+\begin_body
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+chapter{Toisen luvun otsikko}
+\end_layout
+
+\end_inset
+
+ 
+\begin_inset CommandInset label
+LatexCommand label
+name "Toinen luku"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Lisää tekstiä.
+ Lisää tekstiä.
+ Lisää tekstiä.
+ Lisää tekstiä.
+ Lisää tekstiä.
+ Lisää tekstiä.
+ Lisää tekstiä.
+ Lisää tekstiä.
+ Lisää tekstiä.
+ Lisää tekstiä.
+ Lisää tekstiä.
+ Lisää tekstiä.
+\end_layout
+
+\end_body
+\end_document
diff --git a/latex/toinenluku.tex b/latex/toinenluku.tex
new file mode 100644
index 0000000000000000000000000000000000000000..92b1e908d32999cb04823a0aa5de6bd3228cc5b2
--- /dev/null
+++ b/latex/toinenluku.tex
@@ -0,0 +1,5 @@
+\chapter{Toisen luvun otsikko} \label{Toinen luku}
+
+Lisää tekstiä. Lisää tekstiä. Lisää tekstiä. Lisää tekstiä. Lisää
+tekstiä. Lisää tekstiä. Lisää tekstiä. Lisää tekstiä. Lisää tekstiä.
+Lisää tekstiä. Lisää tekstiä. Lisää tekstiä.
diff --git a/latex/utuftthesis.cls b/latex/utuftthesis.cls
new file mode 100644
index 0000000000000000000000000000000000000000..3413f578f9061beeb45cefc12b2c8fbce7760b95
--- /dev/null
+++ b/latex/utuftthesis.cls
@@ -0,0 +1,525 @@
+% version 2.1 2018/10/02 Bugfixes: removed redundant tutkielma.tex, fixed issues with appendices, small caps, added an option to enable the truetype times new roman font
+% version 2.0 2018/08/29 new version using document classes, xelatex, biblatex, and some additional TeX scripting by Jari-Matti Mäkelä (jmjm@iki.fi), based on v1.3 by Sami Nuuttila (samnuutt@utu.fi), Johannes Holvitie (jjholv@utu.fi) et al.
+% version 1.3+ 1.10.2017//10/1 - 2016/9/22 additions marked "JH:", modified for use in tex.soft.utu.fi, Johannes Holvitie (jjholv@utu.fi)
+% version 1.3 2015/9/5 Sami Nuuttila (samnuutt@utu.fi)
+
+% ------------------------------
+% How to use? Store the file in
+% 1) Windows XP C:\Documents and Settings\<user name>\texmf\tex\latex\local\
+% 2) Windows Vista/7 C:\Users\<user name>\texmf\tex\latex\local\
+% 3) Linux ~/texmf/tex/latex/local/
+% 4) Mac OS X /Users/<user name>/Library/texmf/tex/latex/local/
+% 5) Sharelatex: just copy this to the project folder
+% 6) or in the same directory as the document
+% ------------------------------
+
+\NeedsTeXFormat{LaTeX2e}[2007/01/01]
+\ProvidesClass{utuftthesis}[2018/10/02 UTU FT dept BSc/MSc thesis]
+
+\RequirePackage{kvoptions}
+
+\newcommand{\n@tivelang}{finnish}
+
+%% Custom package options
+%\DeclareStringOption[00]{year}
+\DeclareStringOption[draft]{version}
+\DeclareStringOption[a4paper]{paper}
+\DeclareStringOption[finnish]{language}
+\DeclareStringOption[true]{hidechapters}
+\DeclareStringOption[false]{includereferences}
+\DeclareStringOption[false]{realtimesnewroman}
+\DeclareStringOption[false]{sharelatex}
+
+%% Process given options
+\ProcessKeyvalOptions*
+
+%% Fallback
+%\DeclareOption*{}
+%  \ClassWarning{myclass}{Unknown option '\CurrentOption'}
+%\ProcessOptions\relax
+
+%% Load base
+\LoadClass[\utuftthesis@paper,12pt]{report}
+
+\RequirePackage{ifthen}
+
+%% Some language macros for choosing between content
+\newcommand{\langchoose}[3]{\ifthenelse{\equal{#1}{\n@tivelang}}{#2}{#3}}
+\newcommand{\langfin}[2]{\ifthenelse{\equal{\utuftthesis@language}{\n@tivelang}}{#1}{#2}}
+\newif\iffin
+\langfin{\fintrue}{\finfalse}
+
+\RequirePackage{ifxetex}
+
+%% Set up encoding/font/hyphenation stuff
+\ifxetex
+  \RequirePackage{fontspec}
+  \RequirePackage{polyglossia}
+  \setmainlanguage{\utuftthesis@language}
+  \iffin
+  \setotherlanguage{english}
+  \else
+  \fi
+  \ifthenelse{\equal{\utuftthesis@realtimesnewroman}{true}}{
+    \ifthenelse{\equal{\utuftthesis@sharelatex}{true}}{
+      \setmainfont[
+      BoldFont=timesbd.ttf,
+      ItalicFont=timesi.ttf,
+      BoldItalicFont=timesbi.ttf
+      ]{times.ttf}
+    }{
+    \setmainfont{Times New Roman}
+    }
+  }{}
+\else
+% JH: modified latin to UTF-8 encoding cues to make Scandinavian characters works
+  \RequirePackage[T1]{fontenc}
+  \RequirePackage[utf8]{inputenc}
+% load babel-package for automatic hyphenation
+  \iffin
+  \RequirePackage[english, \utuftthesis@language]{babel}
+  \else
+  \RequirePackage[\utuftthesis@language]{babel}
+  \fi
+  \RequirePackage{lmodern}
+  % change default font to times-roman
+  \renewcommand{\sfdefault}{phv}
+  \renewcommand{\rmdefault}{ptm}
+  \renewcommand{\ttdefault}{pcr}
+\fi
+
+\RequirePackage{csquotes}
+
+%% Macro for hiding the chapter texts
+\ifthenelse{\equal{\utuftthesis@hidechapters}{true}}{
+  \renewcommand{\@chapapp}{\relax}
+  \renewcommand{\@makechapterhead}[1]{%
+    \vspace*{50\p@}%
+    {\parindent \z@ \raggedright \normalfont
+      \ifnum \c@secnumdepth >\m@ne
+          \huge\bfseries \@chapapp\space \thechapter\space\space
+      \fi
+      \interlinepenalty\@M
+      \Huge \bfseries #1\par\nobreak
+      \vskip 40\p@
+    }}
+}
+{}
+
+%% load ams-packages for maths
+\RequirePackage{amssymb,amsthm,amsmath}
+
+%% load graphicx package
+%   - automagically select proper parameters depending on whether
+%     we're running pdflatex or latex
+%   - specify \includegraphics{file} without the file extension
+%     (.eps /.pdf (/ .png / .jpeg / ...)), tex should select the proper file
+%
+\RequirePackage{ifpdf}
+\RequirePackage{graphicx}
+
+%% JM: this note refers to some pre-historic latex distributions, probably
+%% safe to disregard
+%% 
+%% !!! NOTE: if you have ancient LaTeX distribution then you might need to
+%% use the following instead
+%% \newif\ifpdf
+%% \ifx\pdfoutput\undefined
+%%   \pdffalse
+%% \else
+%%   \pdfoutput=1
+%%   \pdftrue
+%% \fi
+%% % if graphicx complains about option clash remove the [pdftex] option
+%% \ifpdf
+%%   \RequirePackage[pdftex]{graphicx}
+%% \else
+%%   \RequirePackage[dvips]{graphicx}
+%% \fi
+
+\RequirePackage[style=ieee,backend=biber]{biblatex}
+
+%% Define new title texts for the bibliography
+\langfin
+{\newcommand{\refs}{Lähdeluettelo}}
+{\newcommand{\refs}{References}}
+
+%% Modify the \printbibliography command
+\defbibheading{bibliography}{
+%\eofpages
+% label here if we don't include references
+\ifthenelse{\equal{\utuftthesis@includereferences}{true}}{}{\label{endofpages}}
+\chapter*{\refs}
+\addcontentsline{toc}{chapter}{\refs}}
+
+\let\oldprintbibliography\printbibliography
+\renewcommand{\printbibliography}{
+\oldprintbibliography
+% label here if we also include references
+\ifthenelse{\equal{\utuftthesis@includereferences}{true}}{\label{endofpages}}{}
+}
+
+%% load sverb package
+%   - enhanced handling of verbatim stuff; listing environment
+\RequirePackage{sverb}
+
+%% load listings package
+%   - handle inclusion of source code
+\RequirePackage{listings}
+
+%% load fancyheaders package
+%   - the actual headers and footers are set later
+\RequirePackage{fancyhdr}
+
+%% these are used as global variables on the magic pages
+%% feel free to modify if/when the department changes again
+\newcommand{\ye@r}{\the\year}
+\newcommand{\m@nth}{\the\month}
+\newcommand{\s@pervisors}{}
+\newcommand{\version}{\utuftthesis@version}
+\newcommand\keywords[1]{\def\k@ywords{#1}}
+\newcommand\keywordstwo[1]{\def\k@ywordstwo{#1}}
+\newcommand\pubyear[1]{\renewcommand\ye@r{#1}}
+\newcommand\pubmonth[1]{\renewcommand\m@nth{#1}}
+\newcommand\publab[2]{\newcommand\p@blab{#1}\newcommand\p@blaben{#2}}
+\newcommand\pubtype[1]{\newcommand\p@btype{#1}}
+\newcommand\supervisors[1]{\renewcommand\s@pervisors{#1}}
+\newcommand{\laitos}{Tulevaisuuden teknologioiden laitos}
+\newcommand{\yliopisto}{Turun yliopisto}
+\newcommand{\department}{Department of Future Technologies}
+\newcommand{\university}{University of Turku}
+
+% switch-case used to select the thesis type
+\newboolean{default}
+\newcommand{\case}{}
+\newcommand{\default}{}
+\newenvironment{switch}[1]{%
+    \setboolean{default}{true}
+    \renewcommand{\case}[2]{\ifthenelse{\equal{#1}{##1}}{%
+        \setboolean{default}{false}##2}{}}%
+    \renewcommand{\default}[1]{\ifthenelse{\boolean{default}}{##1}{}}
+}{}
+
+%% magic thesis types. more can be added
+\newcommand*{\thesistype}[1]{ \begin{switch}{\p@btype}
+      \case{tkk}{\langchoose{#1}{TkK -tutkielma}{Bachelor's Thesis}}%
+      \case{luk}{\langchoose{#1}{LuK -tutkielma}{Bachelor's Thesis}}%
+      \case{gradu}{\langchoose{#1}{Pro gradu -tutkielma}{Master of Science Thesis}}%
+      \case{di}{\langchoose{#1}{Diplomityö}{Master of Science Thesis}}%
+    \default{\p@btype}%
+    \end{switch}}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% setup document appearance
+%
+
+% fix page size
+%
+%  - page width: 
+%     1inch             +
+%      \hoffset         +
+%      \oddsidemargin   +
+%      \textwidth       +
+%      \marginsep       +
+%      \marginparwidth
+%
+%  - page height: 
+%     1inch             +
+%      \voffset         +
+%      \topmargin       +
+%      \headheight      +
+%      \headsep         +
+%      \textheight      +
+%      \footnotesep     +
+%      \footheigth 
+%
+%  - 1 pt == 1/72 inch == 0.35 mm
+%
+% page width... left margin 4cm, right 2cm
+%
+\setlength{\hoffset}{0mm}
+\setlength{\marginparsep}{0mm}
+\setlength{\marginparwidth}{0mm}
+\setlength{\textwidth}{\paperwidth}
+\addtolength\textwidth{-60 mm}
+\setlength{\oddsidemargin}{-1 in}
+\addtolength\oddsidemargin{40 mm}
+%
+% page height... textheight starts at ~4cm from top, 
+% i.e. 1 in + 12 pt + 24 pt = 1.5 in 
+%
+\setlength{\voffset}{0 mm}
+\setlength{\topmargin}{0 mm}
+\setlength{\headheight}{14.5 pt}
+\setlength{\headsep}{24 pt}
+\setlength{\textheight}{230mm}
+\setlength{\footnotesep}{12 pt}
+
+ 
+% setup linespacings to suit to the (stupid) requirement of double spacing
+%
+% - fake 1.5 linespacing
+%    \renewcommand{\baselinestretch}{1.241}
+%
+% - fake 2 linespacing
+%
+\renewcommand{\baselinestretch}{1.655}
+
+%% this way the user can choose whatever date library for other stuff
+\newcommand{\MONTH}[1]{%
+  \ifcase#1
+  \or January% 1
+  \or February% 2
+  \or March% 3
+  \or April% 4
+  \or May% 5
+  \or June% 6
+  \or July% 7
+  \or August% 8
+  \or September% 9
+  \or October% 10
+  \or November% 11
+  \or December% 12
+  \fi}
+\newcommand{\KUUKAUSI}[1]{%
+  \ifcase#1
+  \or Tammikuu% 1
+  \or Helmikuu% 2
+  \or Maaliskuu% 3
+  \or Huhtikuu% 4
+  \or Toukokuu% 5
+  \or Kesäkuu% 6
+  \or Heinäkuu%7
+  \or Elokuu% 8
+  \or Syyskuu% 9
+  \or Lokakuu% 10
+  \or Marraskuu% 11
+  \or Joulukuu% 12
+  \fi}
+  
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% provide the entry environment
+%
+
+\newenvironment{entry}[1]
+{\begin{list}{}{%
+      \renewcommand{\makelabel}[1]{\textrm{##1:}\hfil}%
+      \settowidth{\labelwidth}{\textrm{#1:}}%
+      \setlength{\leftmargin}{\labelwidth}%
+      \addtolength{\leftmargin}{\labelsep}}}
+{\end{list}}
+
+
+%% appendix title, abstract environments
+\langfin{
+  \newcommand{\appname}{Liitteet}
+  \renewenvironment{abstract}{\@bstracth{finnish}}{\@bstractt{finnish}{\k@ywords}}
+}{
+  \newcommand{\appname}{Appendices}
+  \renewenvironment{abstract}{\@bstracth{english}}{\@bstractt{english}{\k@ywords}}
+}
+
+%% used for listing the supervisors
+\RequirePackage{pgffor}
+
+%% title page, reuses the standard \maketitle
+\renewcommand*{\maketitle}{%
+\clearpage 
+\thispagestyle{empty}
+\vspace*{\stretch{1}}
+\vspace{3mm}
+\noindent 
+\rule{\linewidth}{1 mm}
+\renewcommand{\baselinestretch}{1.05}\normalsize
+\begin{flushright}
+\Huge{\@title}
+\end{flushright}
+\rule{\linewidth}{1 mm}
+\vspace*{\stretch{4}}
+\\
+\renewcommand{\baselinestretch}{1}\normalsize
+ \iffin
+ \begin{tabular}{p{80 mm}p{70 mm}}           \\
+ & \thesistype{\n@tivelang} \\
+ \else
+\begin{tabular}{p{78 mm}p{72 mm}}            \\
+ & \thesistype{english}                              \\
+ \fi
+ & \langfin{\yliopisto}{\university}   \\
+ & \langfin{\laitos}{\department}      \\
+ & \langfin{\p@blab}{\p@blaben}        \\
+ & \ye@r                               \\
+ & \@author                            \\
+\ifthenelse{\equal{\s@pervisors}{}}{
+}{
+ &                                           \\
+ & \langfin{Tarkastajat}{Supervisors}:                              \\ 
+ \foreach \x in \s@pervisors {
+\begin{tabular}{p{78 mm}p{72 mm}}            
+ & \hspace*{4 ex} \x         \\
+\end{tabular}
+}}
+\end{tabular}
+\vspace*{\stretch{1}}\\
+\begin{minipage}[b]{\textwidth}
+\scriptsize \langfin{{\yliopisto}n laatujärjestelmän mukaisesti tämän julkaisun alkuperäisyys on tarkastettu Turnitin OriginalityCheck-järjestelmällä.}{
+The originality of this thesis has been checked in
+accordance with the \university quality assurance system using
+the Turnitin OriginalityCheck service.}
+\end{minipage}
+\renewcommand{\baselinestretch}{1.655}\normalsize
+\clearpage
+}
+
+%% used to detect the number of pages
+\RequirePackage[page]{totalcount}
+
+%% used to detect the empty \totalpages on the first latex run
+\newcommand*{\IsInteger}[3]{%
+    \IfStrEq{#1}{ }{%
+        %#3% is a blank string
+    }{%
+        \IfInteger{#1}{#2}{#3}%
+    }%
+}%
+
+\RequirePackage{xstring}
+  
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% define itabstract environment for abstract page
+%
+\newcommand{\@bstracth}[1]{%
+  \selectlanguage{#1}
+  \langchoose{#1}{
+    \newcommand{\uni}{\yliopisto}
+    \newcommand{\dep}{\laitos}
+    \newcommand{\@pp}{s.}
+    \newcommand{\@app}{liites.}
+  }
+  {
+    \newcommand{\uni}{\university}
+    \newcommand{\dep}{\department}
+    \newcommand{\@pp}{p.}
+    \newcommand{\@app}{app. p.}
+  }
+  
+  \setlength{\headheight}{0 pt}
+  \setlength{\headsep}{0 pt}
+  \addtolength\topmargin{-0.54 cm}
+  \renewcommand{\baselinestretch}{1}\normalsize
+  \clearpage
+  \thispagestyle{empty}
+  \noindent
+  \begin{minipage}[\textheight]{\linewidth}
+  \MakeUppercase{\uni}\\
+  \dep
+  \begin{entry}{}
+  \item[\textsc{\@author}] \@title
+  \end{entry}
+\IsInteger{\totalpages}{
+\ifnum \totalpages > 0
+  \thesistype{#1}, \pageref{endofpages} \@pp, \totalpages\ \@app \\
+\else
+  \thesistype{#1}, \pageref{endofpages} \@pp \\
+\fi
+}
+{\thesistype{#1}, \langfin{aja LaTeX uudestaan}{please rerun LaTeX} \\
+}
+  \langchoose{#1}{\p@blab}{\p@blaben}\\
+  \langchoose{#1}{\KUUKAUSI{\m@nth}}{\MONTH{\m@nth}} \ye@r \\
+  \rule{\linewidth}{1 pt}
+  \\
+}
+
+\newcommand{\@bstractt}[2]{%
+\bigskip
+\\
+\selectlanguage{#1}
+\newcommand{\kwlabel}{\langchoose{#1}{Asiasanat}{Keywords}}
+\begin{entry}{}
+\item[\kwlabel] #2
+\end{entry}
+\end{minipage}
+\clearpage
+\setcounter{page}{0}
+\setlength{\headheight}{12 pt}
+\setlength{\headsep}{24 pt}
+\setlength{\topmargin}{0 mm}
+\renewcommand{\baselinestretch}{1.655}\normalsize
+}
+
+%% the second abstract environment
+\newenvironment{abstracten}{\@bstracth{english}}{\@bstractt{english}{\k@ywordstwo}}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% 
+% define \figcaption and \tblcaption for use with non-floating figures and 
+% tables
+%
+
+\makeatletter
+  \newcommand\figcaption{\def\@captype{figure}\caption}
+  \newcommand\tblcaption{\def\@captype{table}\caption}
+\makeatother
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% define \startpages
+%
+\newcommand{\startpages}{%
+        \clearpage
+        \pagenumbering{arabic}
+        \setcounter{page}{1}
+        \renewcommand{\baselinestretch}{1.655}
+
+        \pagestyle{fancy}
+        \renewcommand{\chaptermark}[1]{
+          \markboth{
+            \MakeUppercase{\chaptername\ \thechapter.\ ##1}}
+          {}
+        }
+        \lhead{\leftmark}
+
+\chead{\ifthenelse{\equal{draft}{\version}}{[draft]}{}}
+        \rhead{\thepage}
+        \fancyfoot{}
+  \setcounter{totalcount@page}{-1000}
+}       
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% define \appendices
+%
+\newcommand{\appendices}{%
+  \newpage
+  \appendix
+  \addtocontents{toc}{\protect\contentsline{chapter}{\appname}{}\relax}
+  \renewcommand{\chaptermark}[1]{\markboth{\MakeUppercase{\appendixname\ \thechapter.\ ##1}}{}}
+  \lhead{\leftmark}
+  \chead{}
+  \rhead{\thechapter-\arabic{page}}
+  \fancyfoot{}
+  \setcounter{page}{0}
+  \renewcommand\thepage{\thechapter-\arabic{page}}
+  \setcounter{totalcount@page}{-1}
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% define \appchapter
+%
+\newcommand{\appchapter}[1]{%
+        \addtocounter{totalcount@page}{\value{page}}
+        \clearpage
+        \setcounter{page}{1}
+        \chapter{#1}
+}
+
+%% automatically handle the appendix magic
+%\AtEndDocument{\addtocounter{totalcount@page}{-2}}
diff --git a/latex/utuftthesis.layout b/latex/utuftthesis.layout
new file mode 100644
index 0000000000000000000000000000000000000000..ccfca8d411523e6c46de19ef7b86369e90d380f0
--- /dev/null
+++ b/latex/utuftthesis.layout
@@ -0,0 +1,126 @@
+#% Do not delete the line below; configure depends on this
+#  \DeclareLaTeXClass{UTU FT Thesis}
+#  \DeclareCategory{Articles}
+# UTU FT thesis document class, based on report
+# Author : Jari-Matti Mäkelä <jmjm@iki.fi>
+
+Format 60
+Input stdclass.inc
+
+SecNumDepth            3
+TocDepth               3
+
+Provides fontenc       1
+Provides url           1
+Provides geometry      1
+Provides babel         1
+Provides amsmath       1
+Provides amssymb       1
+Provides fontspec      1
+Provides graphicx      1
+Provides biblatex      1
+
+Style Appendix
+    CopyStyle     Chapter
+    LatexName     appchapter
+    LabelString   "Appendix" # For the menu?
+End
+
+Style PubYear
+    Margin                Dynamic
+    LatexType             Command
+    LatexName             pubyear
+    LabelType   Static
+    LabelString           "Publication year:"
+    Align                 Center
+    Font
+      Size                Large
+    EndFont
+End
+
+Style PubMonth
+    Margin                Dynamic
+    LatexType             Command
+    LatexName             pubmonth
+    LabelType   Static
+    LabelString           "Publication month: "
+    Align                 Center
+    Font
+      Size                Large
+    EndFont
+End
+
+Style PubLab
+    Margin                Dynamic
+    LatexType             Command
+    LatexName             publab
+    LabelType   Static
+    LabelString           "Laboratory name: "
+    Align                 Center
+    Font
+      Size                Large
+    EndFont
+End
+
+Style PubType
+    Margin                Dynamic
+    LatexType             Command
+    LatexName             pubtype
+    LabelType   Static
+    LabelString           "Publication type (tkk/luk/gradu/di): "
+    Align                 Center
+    Font
+      Size                Large
+    EndFont
+End
+
+Style Keywords
+    Margin                Dynamic
+    LatexType             Command
+    LatexName             keywords
+    LabelType   Static
+    LabelString           "Keywords: "
+    Align                 Center
+    Font
+      Size                Large
+    EndFont
+End
+
+
+Style KeywordsEnglish
+    Margin                Dynamic
+    LatexType             Command
+    LatexName             keywordstwo
+    LabelType   Static
+    LabelString           "Keywords (english): "
+    Align                 Center
+    Font
+      Size                Large
+    EndFont
+End
+
+Style AbstractEnglish
+    CopyStyle     Abstract
+    LatexName     abstracten
+    LabelString   "Abstract (english)" # For the menu?
+End
+
+Style Part
+    Align                 Left
+    AlignPossible         Left
+    TopSep                2
+    BottomSep             1.5
+    Font
+      Size                Larger
+    EndFont
+End
+
+Style Part*
+    Align                 Left
+    AlignPossible         Left
+    TopSep                2
+    BottomSep             1.5
+    Font
+      Size                Larger
+    EndFont
+End