Simplified for loop just use length directly.
Remove extra semicolons (thanks @meacer).