delete all unnecessary functions and debug func and comments