Revised comments and variable names
Modified index.php view: Added condition if there is no thread to display from DB