ex2 almost working
close to perfection