Working on serial implementation