Comverted pbl_main to main (SDK 2.0)