Update Index.java

optimized