use generic algorithm