recalculate bars length, rather than in loop
remove unused col_bg variable