fixed paths and changed to make refactoring this logic easier later