add algorithms java