Added polygon union (and fixed many bugs)