if you Search this forum you will Find all the Algo you need to do that
and how to do it too