The present invention relates to new compounds of the formula (I), (II), or (III) wherein R1, R2, R3, R4, R5 and W are as defined herein, and pharmaceutical compositions containing them, and their use in the treatment of amyloid diseases, especially Aβ amyloid disease, such as observed in Alzheimer's disease, infectious diseases, PAI-I related disease, and in the manufacture of medicaments for such treatment.