Adding comments for clarity and improving my understanding of Prolog.
Not sure what I did in this commit