Simplified filePath parsing for date. Added some comments for functions.