Completing the comments and optimizing a little

Compilers might do these optimizations automatically, but I'm not sure...