working version with multiple folders