implement LegendreQ