algorithm taking shape