Added comments, javadocs and copyright