Gave an answer to the actual question.
Added answer to ex2.