Sorry HenrikOlsson for the frustration. I figured it out just now, it wasn't the code. It was my anti-virus software, I had ransom ware protection on. This somehow allowed some of the pic to be programmed but would act screwy. I checked off ransom ware protection and reprogrammed the chip same code, everything works as it should now. Thank you for your help.