Main program skeleton implemented