fixed 'ffa' algorithm