An old 3rd-year university project. Written in 2009.