what's this block of code aiming to accomplish?  can you add a comment with a tl;dr of this code's purpose?