algorithm code on server