Added line clipping algorithm.