the function of seperate positive and negative is ok now. but the out put file have a problem ,we won't output key