University 3rd year final project. For archiving and perhaps cleaning up.