Tidied code: added loop to print out student names