Updated javadocs, changed code for Capture flag and path finding