Addes javadoc comments and some functionality