1. use a 2 dimensional associative array
2. translate the multidimensional array to an HTML table – make this a function
3. sort the multidimensional array and the just use the HTML translation to output the table – make this also a function
4. move the sort code to BEFORE the HTML table display, and handle the errors caused by initial lack of user input