added line fitting