edited ex2 extra credit