added line functions, investigating bugs