Heterocyclic compounds having nitrogen in the ring