made the line mapping generation neater