Made rotate demo robust