fixed minor problems in the coce generation, and added entry point to the program