refactored directory setup for paths, and added mod