fixed problems following Dennis's comments.