Added a reference sequential implementation.