implement simplifyTrivially to remove unnecessary segment points