semicolon added to $finish
cleaner version of loop.php
optimized count function use
foreach loop