Expanded and corrected solution

Thanks to the help of my friends. I was able to understand the problem
more.