Added compatibility for java 6, did stupid web stuff