ex3 updated with minor changes.