primary algo done