Helpful code for the first exam of 2013F