added splitstring method for getting dir names