WIP get expand_path working, needs refactoring