revised based on Fibich's comments