change the main loop to parfor; some cosmetic tweaks; now, if no parameters are to be optimized, just return the initial seed