Made serial and distributed versions