Added partition function to Hopcroft.