corrected date formatting, fleshed out error cases, uncommented the code that modifies