explanation of code