code from turnitin (http://www.turnitin.com/static/resources/files/turnitintool_v20121204.zip)