added initial java port
optimized a bit
wrote updatable priority queue implementation - gives ~6x speedup, cleanup + structure