Improved fb algorithm