Tidy up drawLines function