changing algorithm for drawing descending lines