cleaned up union function, added fixes to line drawing function