Modified solution. Most of answers are correct :)