Updated according to Dale's comments.