Deleted my time delay functions.
Added TimeDelay.h/.c of Microchip library.
Changed the time delay functions.
Changed the optimization level from 0 to 3.
Recompiled.
Changed the time delay function.