Optimizing the number of Unicorns and buffer size