new generelization algorithm