Update draw_bar() function

Update draw_bar() function to make the process of drawing bar more
efficient