Added while to encore-mode