Slight logic modifcation. Created a separate pde file to separate the function calls form the main driver program