cleaned java code