move analyse functions to separate file analyse_funcs