Thanks, but your code lacks some commands as I can see, like:

OSCCON = %01110111

to set OSC clock to 8mhz