Update main file syntax naming

Added directory variable and changed all old __DIR__ to $dir.