Add outputTotalResults function and and the needed variables for it to work.
Minor comment fixes.
PEP8 commit. All PEP8 warning were removed.