adding some rudimentary sorting