Add tex and fix a bug in ex3