added waaaaayyy more comments to explain to myself what is going on.