code from spring 2010