moved bar-related stuff to bar.c (merged draw.c into that)