Starter code for scattering keys
Clean up
Make naming clearer
Simpler sorting routines