some classical algorithms