Explanation of code.