* You don't use the index `i` in the block
* Can there be the same entity twice in `entities`? If so, then we have a bug here (loop thinking twice that it's at the end). Better use the index here and check for `if i == entities.size-1`