tweaked generate.bars