added initial algorithm to line builder