more descriptive comments and original pseudo-code source