A compound of formula (I) wherein A, X, Y, Z, R and R are described herein. The compounds are useful as inhibitors of potassium channel function and in the treatment and prevention of arrhythmia, I-associated disorders, and other disorders mediated by ion channel function.