Start of code to split primitives into bars