I know you didn't write this (I probably did), but `add` returns the `Polyline`.  Using that would be cleaner than `polylines.get(0)` below.