I am looking at a code written by someone and trying to make sense of it. Please look at picture below
Basically, it involves following steps