refactored, fixed path issues