Code Cleaned And Java Version Updated