A compound of the following formula (I) wherein R<1>, R<2>, R<3>, R<4>, R<5>, R<6>, W, X, Y, Z, m, n, and p are as defined herein. This invention also covers methods for inhibiting dipeptidyl peptidase IV or VIII, or treating Type II diabetes with such a compound.