Added Reversing java method