Added generic function line_data, cleaned comments