added ex6, not working yet