Added threads in java