Finished algorithm realization, removed redundant methods, aplied java docs