update function myAlgo