correcting length calculcation of flatlines