I don't know how reusable this bit of code is. Its pretty unique to the McGill schedule table.