fix off-by-one in lines length