Ian

Merging my own changes into the master branch with victor's changes. Expected heavy merge issues.