Added Java, Python and Perl versions