added intermission function