code from lecture about lists