add explanation of code