my newest code in java. enjoy