added dirtype() function
modified