updated ex5
cleanup for ex6