modifying it to work with space for bars