Add problem 24.
Fix race condition of sending reference type of volatile data on channel.

Also get back some performance lost by preallocating "sofar".
Slight speedup by using arrays of bytes instead of ints where possible.