initial serial implementation