random function uses chars
Fixed empty trailing boxes issue