added new code for ex3