how to run algorithm