implementing rage quit and fixed deal memory leak
Reads h or c by character and adding test cases and script