Original java source

Adding the original java source on which the html and javascript are based