outline of scenario function