FED algorythm