Modified to support subfolders