Matt's code

Manually merged new code into his project.