serial and parallel versions with timing