initial working version
removing thePath variable
fixing up previous work