Added dir() function

Added dir() function