Refactored code to better suit the concepts mentioned in the OID 2014 paper.