Modified the method that sets the bar length