Notes taken directly from comp1405 2012-2013 professor David Morin. Formatted in the following method