Scans directory for files. Adding replace function