added super clean java code (work this time you fucking biaaatch!)