Code from the UVic SENG 440 project