refactored directory to fit asignment specifications