Made days list a global variable and fixed function definitions to reflect change.