Added code for ex7