Figuring out the right number of bins
A compiling version of the code with some stuff debugged but not working due to fixed size arrays
Code which on first impression achieves the O(n) requirement for the serial case.  We'll probabably find bugs later, but yeah... :)