Compiles properly, added another case for line clipping