added bend point penalty for degree-2 nodes