On The Origin And Function Of The Pupal Stage