adding discount java version