Fixed problem with order of lines being drawn