factor-ize
fix the end tangents GUI bug