Mainfunction transition