initial version working with just a basic linear sort