added java threading