Code not finished but includes code that Sheng put in the presentation slide thingymajigs