pasted into one file and refactored tests into a single test() function
some changes to sampleSX to make it more consistent with the rest of the code. Tests still work
changed some lines of updateg to spread functions over multiple lines for readability. Still passed tests.
Merge branch 'master' of https://github.com/jeffreydarling/243group