write that code with more detail and comments explaining how it works