Working Functions

I was summing over the terms which didn't need them.  Although currently
my units are not optimal.  Apologies. Its a working progress