added java version for study purposes