readability
don't wrap an array just to get its length
readability
bug fix
bug fix, continued