rewrote line update using component-wise math to avoid allocations during update, see #316