add Dir() method to package