Cleanuped code and applied it to draw_bg() and draw_part() as well.