updated codes to reflect examples we did in class on March 18, 2014