added comments and fixed download spreadsheet method