Update ex2 for greater functionality