Can you explain what the code is doing? Try adding comments to the code.