Dynammic algorithm working.