finished lineClipping. non recursive solution