Added compensation code for inaccurate lines