finished tidyup of version1
fixed merge conflicts
fixed master so it runs - still strange issues with the two threads and communication arg.
fixed so starting from bubble down works just as well as starting from bubble up
algorithm deadlocks where the two threads cross over.  Need to implement a 'reset' to allow the second thread to back down from any contention.
exchanged semaphore to AtomicBoolean so can check whether available or not
extracted out acquire() and release() into methods to make code easier to read
it works yay
works excpet for large arrays, and throws errors when exiting.
made the nodes wait until master tells them all are done before close connections - also did some tidyups of unnecessary locking etc.
changed main to work a bit better with debugging