This the some algorithm code