added test for uniqueness of dept, tidied up some of the dept spreadsheet code