Added more logic for coastal lines