\documentclass[a4paper,10pt,titlepage]{report}
\linespread{0.9}
\usepackage{setspace}
%\onehalfspacing  % 1.5 spacing is uuuglly
 \parskip 10pt           % sets spacing between paragraphs
 %\renewcommand{\baselinestretch}{1.5} 	% Uncomment for 1.5 spacing between lines
 %\parindent 0pt		  % sets leading space for paragraphs


%\usepackage{natbib}
\usepackage{makeidx}
\usepackage{graphicx}
\usepackage{caption}
%\usepackage{subfigure}
\usepackage{rotating}
%\usepackage{lscape} % Needed for landscaping when printing
\usepackage{pdflscape} % Needed for landscaping - in pdf viewer
\usepackage{verbatim}
\usepackage{amsmath, amsthm,amssymb}
\usepackage{mathrsfs}
\usepackage{hyperref}

\usepackage{epstopdf}
\usepackage{float}
\usepackage[compact]{titlesec}
\titlespacing{\chapter}{0pt}{0pt}{0pt}
\titleformat{\chapter}
{\normalfont\LARGE\bfseries}{\thechapter.}{1em}{}

\usepackage{color}
\usepackage{listings}

\definecolor{darkgray}{rgb}{0.95,0.95,0.95}
\definecolor{darkred}{rgb}{0.75,0,0}
\definecolor{darkblue}{rgb}{0,0,0.75}
\definecolor{pink}{rgb}{1,0.5,0.5}
\lstset{language=Java}
\lstset{backgroundcolor=\color{darkgray}}
\lstset{numbers=left, numberstyle=\tiny, stepnumber=1, numbersep=5pt}
\lstset{keywordstyle=\color{darkred}\bfseries}
\lstset{commentstyle=\color{darkblue}}
%\lstset{stringsyle=\color{red}}
\lstset{showstringspaces=false}
\lstset{basicstyle=\small}

%\usepackage{endfloat}
%\nomarkersintext
 \topmargin -1.5cm        % read Lamport p.163
 \oddsidemargin -0.04cm   % read Lamport p.163
 \evensidemargin -0.04cm  % same as oddsidemargin but for left-hand pages
 \textwidth 16.59cm
 \textheight 23.94cm 
 %\pagestyle{empty}       % Uncomment if don't want page numbers
 \parskip 6.2pt           % sets spacing between paragraphs
 \renewcommand{\baselinestretch}{1.5} 	% Uncomment for 1.5 spacing between lines
 \parindent 0pt		  % sets leading space for paragraphs

\usepackage{fancyheadings}
\pagestyle{fancy}
\addtolength{\headheight}{2.5pt}
\renewcommand{\chaptermark}[1]{\markboth{\thechapter~~#1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection~~#1}{}}
\ifthenelse{\boolean{@twoside}}
{
        \rhead[\bfseries \rightmark]{\bfseries \thepage}
        \lhead[\bfseries \leftmark]{\bfseries \thepage}
        \addtolength{\headwidth}{\marginparsep}
        \addtolength{\headwidth}{\marginparwidth}
}{
        \lhead{\bfseries \leftmark}
        \rhead{\bfseries \thepage}
}
\cfoot{}

%---------------------------------------------------------
%---------------------------------------------------------
\begin{document}

\include{titlepage/Titlepage}               % This is who you are

\pagenumbering{roman}
\newpage
%---------------------------------------------------------
% Do the table of Contents and lists of figures and tables
%---------------------------------------------------------
\tableofcontents
\markboth{}{}
\newpage

\pagenumbering{arabic}
%---------------------------------------------------------
%---------------------------------------------------------
%Include the chapters!

%\include{chapters/Demonstration}
\include{chapters/Introduction}
\include{chapters/Approach}
\include{chapters/Design}
\include{chapters/Results}
%\newpage
%---------------------------------------------------------
\renewcommand{\bibname}{References}
\bibliography{references/refs}
%\bibliographystyle{apalike}  
\addcontentsline{toc}{part}{References}
%---------------------------------------------------------

% Appendices

%---------------------------------------------------------

\end{document}

