Thanks for help...algo is now working...