diff --git a/CHANGELOG.md b/CHANGELOG.md
index bb1b831..59d4968 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,13 @@
# Changelog
+## [0.4] - March 10, 2020
+
+### Changed [⚠️ Breaking Changes]
+- `getShareScores` & `getInsights` have been decoupled from the check class, they now have to imported separately.
+- Minor changes in the `analyze.py` module.
+
+
## [0.3] - Jan 1, 2020
### Added
diff --git a/demo.py b/demo.py
index 05d0a91..15851cb 100644
--- a/demo.py
+++ b/demo.py
@@ -1,26 +1,30 @@
"""Usage example"""
import os
import pprint
-from plagcheck import plagcheck
+from plagcheck.plagcheck import check, insights, share_scores
from dotenv import load_dotenv
load_dotenv()
-language = "python"
+language = "java"
userid = os.environ["USER_ID"]
-moss = plagcheck.check(language, userid)
+moss = check(language, userid)
-moss.addFilesByWildCard("testfiles/test_python*.py")
+moss.addFilesByWildCard("testfiles/test_java*.java")
# or moss.addFile("testfiles/test_python.py")
moss.submit()
print(moss.getHomePage())
-pprint.pprint(moss.getResults())
-# print frequency of each shared solution
-pprint.pprint(moss.getShareScores())
+
+result = moss.getResults()
+
+pprint.pprint(result)
+
# print potential distributor-culprit relationships
-pprint.pprint(moss.getInsights())
+pprint.pprint(insights(result))
+# print frequency of each shared solution
+pprint.pprint(share_scores(result))
diff --git a/docs/changelog.md b/docs/changelog.md
index 3ebae28..5b56bd5 100644
--- a/docs/changelog.md
+++ b/docs/changelog.md
@@ -1,6 +1,13 @@
# Changelog
+## [0.4] - March 10, 2020
+
+### Changed [⚠️ Breaking Changes]
+- `getShareScores` & `getInsights` have been decoupled from the check class, they now have to imported separately.
+- Minor changes in the `analyze.py` module.
+
+
## [0.3] - Jan 1, 2020
### Added
diff --git a/docs/insights.md b/docs/insights.md
new file mode 100644
index 0000000..47bba54
--- /dev/null
+++ b/docs/insights.md
@@ -0,0 +1,51 @@
+# Insights
+
+PlagCheck provides algorithmic analysis of Moss results.
+
+### Terminologies
+
+### 1. Node
+Nodes are results returned by Moss i.e every
+individual file.
+
+### 2. Tags
+Tags are roles which a file serves i.e. a tag is
+a potential distributor or potential culprit or
+both.
+
+### 3. M-group
+m-groups (moss-groups) are groups of solution which have similar code.
+For example A student who solves a programming problem may share their
+solution with 3 of his/her friends, that is a single m-group with 4 nodes.
+
+For example if you run [demo.py](https://github.com/codeclassroom/PlagCheck/blob/master/demo.py), `insights()` will return the following data:
+```java
+
+{'DCtoC Paths': [('testfiles/test_java5.java', 'testfiles/test_java2.java'),
+ ('testfiles/test_java4.java', 'testfiles/test_java2.java')],
+ 'DtoC Paths': [('testfiles/test_java3.java', 'testfiles/test_java2.java'),
+ ('testfiles/test_java3.java', 'testfiles/test_java.java'),
+ ('testfiles/test_java7.java', 'testfiles/test_java6.java')],
+ 'DtoDC Paths': [('testfiles/test_java3.java', 'testfiles/test_java5.java'),
+ ('testfiles/test_java3.java', 'testfiles/test_java4.java')]}
+
+```
+
+This analysis can be visualized into following _Disconnected Directed Graph_
+
+
+
+We assign Tags to every individual Node.
+
+1. D - Distributor
+Student(s) who distributed their
+code in a group.
+2. C - Culprit
+Student(s) who copied the shared
+code.
+3. DC - Both a Distributor & Culprit
+
+In the above depicted graph, there are 2 unique _m-groups_.
+
+1. Group 1 : [1, 2, 3, 4, 5]
+2. Group 2 : [7, 6]
\ No newline at end of file
diff --git a/docs/installation.md b/docs/installation.md
index 8d4f9f1..82c173d 100644
--- a/docs/installation.md
+++ b/docs/installation.md
@@ -2,16 +2,24 @@
Installing plagcheck is pretty simple, just run
-`pip install plagcheck`
+```bash
+pip install plagcheck
+```
Install a specific verison
-`pip install plagcheck==0.2`
+```bash
+pip install plagcheck==0.4
+```
or directly from GitHub if you cannot wait to test new features
-`pip install git+https://github.com/codeclassroom/PlagCheck.git`
+```bash
+pip install git+https://github.com/codeclassroom/PlagCheck.git
+```
-If you have already installed it and want to update
+If you have a old version, update it using
-`pip install --upgrade plagcheck`
\ No newline at end of file
+```bash
+pip install --upgrade plagcheck
+```
\ No newline at end of file
diff --git a/docs/usage.md b/docs/usage.md
index 37d864c..5fbf539 100644
--- a/docs/usage.md
+++ b/docs/usage.md
@@ -1,6 +1,6 @@
# Usage
-plagcheck provides the following classes:
+plagcheck provides the following classes & methods:
### check(files, lang, user_id)
@@ -16,29 +16,33 @@ plagcheck provides the following classes:
"""Usage example"""
import os
import pprint
-from plagcheck import plagcheck
+from plagcheck.plagcheck import check, insights, share_scores
from dotenv import load_dotenv
load_dotenv()
-language = "python"
+language = "java"
userid = os.environ["USER_ID"]
-moss = plagcheck.check(language, userid)
+moss = check(language, userid)
-moss.addFilesByWildCard("testfiles/test_python*.py")
+moss.addFilesByWildCard("testfiles/test_java*.java")
# or moss.addFile("testfiles/test_python.py")
moss.submit()
print(moss.getHomePage())
-pprint.pprint(moss.getResults())
-# print frequency of each shared solution
-pprint.pprint(moss.getShareScores())
+
+result = moss.getResults()
+
+pprint.pprint(result)
+
# print potential distributor-culprit relationships
-pprint.pprint(moss.getInsights())
+pprint.pprint(insights(result))
+# print frequency of each shared solution
+pprint.pprint(share_scores(result))
```
@@ -72,18 +76,6 @@ c.getHomePage()
```python
c.getResults()
-"""
-[
- {
- "file1":"filename1.py",
- "file2":"filename2.py",
- "percentage": 34,
- "no_of_lines_matched": 3,
- "lines_matched":[["2-3", "10-11"]]
- },
-....
-]
-"""
```
@@ -162,14 +154,16 @@ program code that also appears in the base file is not counted in matches.
code for an assignment. Multiple Base files are allowed.
- You should use a base file if it is convenient; base files improve results, but are not usually necessary for obtaining useful information.
-### 7. getShareScores()
-**Parameters** : `None`
+