Removed hardcoded datadir to a easy to change var
Fixed tabbing on one line
Removed strange case statement