Added functions for finding "best" variables