Lab 6.5 - Direct copy and paste of Ross' code.