add entrance: main function and fix print bug