A simple route to isoindoles and related heterocycles