Finished writing the lga alg. Seems to work, but I still need to confirm that.

I may choose to write a few unit test for the global and localglobal algs
just to confirm they work.