Prep work for sorting