Better initializing and better grabbing of directory name