ex12 rewrite of ex11