Initial sequential implementation.