Merge pull request #31 from waqqasdadabhoy/master

Convert some untyped variables to typed variables, replace custom Sum function with built-in function (in some files, to be done for remaining files).
Merge pull request #1 from DanWBR/master

Merge pull request #31 from waqqasdadabhoy/master