added psuedocode for ex.3