made the setDir function. Tested it and it seems to be working. More tests needed.