Slides and example code from Patricks' EECS 280 discussion section