run algorithm