Source: https://www.cs.bham.ac.uk/~pxc/proj/ProjectReport.pdf