commit from ex 1 and ex 2 from gerwin