-added some additional error checking for partitions and the EPA algorithm, to prevent users
 from doing things wrong