cleanup and reorganisation
proof of concept quick sort