fixed both bars' math