reorganized functions and fix several warnings
reorganized functions and fix several warnings

LyonsLab/coge,asherkhb/coge,LyonsLab/coge,LyonsLab/coge,LyonsLab/coge,asherkhb/coge,asherkhb/coge,asherkhb/coge,LyonsLab/coge,asherkhb/coge,asherkhb/coge,asherkhb/coge,asherkhb/coge,asherkhb/coge,LyonsLab/coge,LyonsLab/coge,LyonsLab/coge,LyonsLab/coge