profile algorithm