diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..bee8a64b79a99590d5303307144172cfe824fbf7
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+__pycache__
diff --git a/README.md b/README.md
index ae43e33f7d11de6ce91ccc34e360647d41be8684..3fe0dac546cfd8efe7eb2c53d30a9e3b82af7fb7 100644
--- a/README.md
+++ b/README.md
@@ -1,92 +1,103 @@
-# IOT - Worksheet 2 part 2
+# Internet Of Things - Worksheet 2 part 2
 
+![image](src/uwe.png)
 
+**Module Name:** Internet Of Things
 
-## Getting started
+**Module Code:** UFCFVK‑15‑2
 
-To make it easy for you to get started with GitLab, here's a list of recommended next steps.
+**Module Leader Name:** Benedict R. Gaster
 
-Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
-
-## Add your files
-
-- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
-- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
-
-```
-cd existing_repo
-git remote add origin https://gitlab.uwe.ac.uk/jo2-holdsworth/iot-worksheet-2-part-2.git
-git branch -M main
-git push -uf origin main
-```
-
-## Integrate with your tools
-
-- [ ] [Set up project integrations](https://gitlab.uwe.ac.uk/jo2-holdsworth/iot-worksheet-2-part-2/-/settings/integrations)
-
-## Collaborate with your team
-
-- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
-- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
-- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
-- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
-- [ ] [Automatically merge when pipeline succeeds](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
-
-## Test and Deploy
-
-Use the built-in continuous integration in GitLab.
-
-- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
-- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
-- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
-- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
-- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
-
-***
-
-# Editing this README
-
-When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template.
-
-## Suggestions for a good README
-Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
-
-## Name
-Choose a self-explaining name for your project.
+- [Internet Of Things - Worksheet 2 part 2](#internet-of-things---worksheet-2-part-2)
+  - [Description](#description)
+    - [Task 1: Binary heap.](#task-1-binary-heap)
+    - [Task 2: Python encode / decode.](#task-2-python-encode--decode)
+    - [Task 3: Server echo.](#task-3-server-echo)
+  - [Getting Started](#getting-started)
+    - [Dependencies](#dependencies)
+    - [Installing](#installing)
+  - [Authors](#authors)
+  - [Version History](#version-history)
+  - [License](#license)
 
 ## Description
-Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
-
-## Badges
-On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
-
-## Visuals
-Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
-
-## Installation
-Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
-
-## Usage
-Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
 
-## Support
-Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
-
-## Roadmap
-If you have ideas for releases in the future, it is a good idea to list them in the README.
-
-## Contributing
-State if you are open to contributions and what your requirements are for accepting them.
-
-For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
-
-You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
-
-## Authors and acknowledgment
-Show your appreciation to those who have contributed to the project.
+Morse code :: Worksheet(2 part 1)\
+This is a rep for only worksheet 2 part 2. Worksheet 2 part 1 can be found here [IOT - Worksheet 2 part 1](https://gitlab.uwe.ac.uk/jo2-holdsworth/iot-worksheet-2-part-1)
+
+
+### Task 1: Binary heap.
+* A binary heap is a data structer that takes the form of a binary tree. In our case this will be a string of character's stored in breadth first order. Following a set of rules and creating an algorithm around those rules we can encode and decode the binary tree.
+* ***inserter.py*** is from the pervious worksheet which can be found here: [IOT - Worksheet 2 part 1](https://gitlab.uwe.ac.uk/jo2-holdsworth/iot-worksheet-2-part-1)  is designed to take an heap string and add values to that heap. It also will add new layers by adding the correct amount of Null characters. This is what the tree looks like in heap form now.![image](src/screenshot1.PNG). The function to insert is very simple and the next worksheet builds on a similar method so it will be very useful. ![image](src/screenshot2.PNG) When we run our new characters to be inserted ![image](src/screenshot3.PNG) we get ![image](src/screenshot4.PNG). This is useful for this task as we will need this string outputted from this for our `decode_bt()`
+* ***def decode_bt(string)*** is located in **binaryheap.py** similar to the last approach in [part 1](https://gitlab.uwe.ac.uk/jo2-holdsworth/iot-worksheet-2-part-1) will will be using a binary tree to decode, however, as discussed this will be in a heap. The heap string is stored in a known format so if we follow that we can decode. Using `tree[0]` we can access the root element of the tree. Using `tree[(2*p)]` where p is the parent\current node we can access the left child. For right child we can use `tree[(2*p)+1]` where p is the parent\current node. Using this logic we can now begin to decode the heap. ![image](src/screenshot5.PNG)
+* ***unittest.py*** unittest is an inbuilt Python library. Its a test runner and is specially design for running tests and debugging. This one contains a few useful tools that we are going to use. It works similarly to the assert function. We've written a few test cases to test things like: Correct, incorrect, invalid inputs for both encode and decode. After running the unittests we spotted a mistake where the decode outputted `-` instead of a `space character`  ![image](src/screenshot6.PNG) to fix this we replaced the head of the heap with a space to return a space character when there is a space.![image](src/screenshot7.PNG) ![image](src/screenshot8.PNG)
+*  ***The differences***
+   *  The different approaches may not seem to to matter, however, on a large scale program the smallest of differences can have large impacts when scaled up. Here is a few comparisions on the decoder developed here and the OOP decoder from [part 1](https://gitlab.uwe.ac.uk/jo2-holdsworth/iot-worksheet-2-part-1)
+   *  **Advantages of OOP implementation**
+      *  The **node()** class has many methods. These methods can change values of the tree meaning the tree can be easily altered at any point in the program by calling the **def setLeftChildNode(nodes)** and **def setLeftChildNode(nodes)**. However, with the heap implementation with would need to use something similar to `convert.py` replacing the string.
+   *  **Disadvantages of OOP implementation**
+      *  If we run `runtime.py` which is a program to test the run time of the programs we can see that the run time of the heap is **10x** faster than OOP, why is this? Current each time **decode** runs it creates the tree object. This takes time to set all the children however  the heap already is setup. If we were to test this where both are already test up we would likely see similar times as they are both **0(n)** ![image](src/screenshot9.PNG) ![image](src/screenshot10.PNG)
+* ***A dictionary implementation?***
+  * Using dictionaries would result in a hybrid implementation of the two. Where dictionaries contain the child's dictionaries. This would likely be done using json format. This would be fairly robust and less costly to later children. However, dictionaries are costly and slow. [An example: p8](http://www.cs.cmu.edu/~15110-f19/slides/week8-2-trees.pdf)
+___
+### Task 2: Python encode / decode.
+* Task two builds on [part 1](https://gitlab.uwe.ac.uk/jo2-holdsworth/iot-worksheet-2-part-1) and explores communication via Ham radios standards.
+* *The CSCT cloud server has a port open on 10105 which contains a morse encoder and decoder. We are required to connect to the service and test its functionality*.
+* To connect to the port on the csct server we need to be able to access the port. Todo this we can port ford the port via VS Code. Using the command `Ctrl + Shift + P`  we can bring up the command wind and open ports: ![image](src/screenshot11.PNG) if we then add the port 10105 ![image](src/screenshot12.PNG) should be able to access that port on our local machine using a browser to access `localhost:10101` as we can see it has worked and we can now connect to the 10105 port on the csct cloud server: ![image](src/screenshot13.PNG)
+* Here are a few example runs of testing the encoder / decoder service:
+  * ![image](src/screenshot13.PNG) ***Sender, Receiver, hello*** encodes to ***..-. . -.-. .. . ...- . .-. -.. . ... . -. -.. . .-. -...- .... . .-.. .-.. --- -...- -.--.***
+* Task two requires use to create a python morse encoder / decoder using a binary tree.
+* Morse.py contains two functions **encode()** and **decode()**. They do what you might expect. encode() takes ascii string and returns a string of `_` or `.` for the corresponding letter. This is done with a binary tree implementation.
+* ***The ham encoder/decoder:***
+  * Ham follows a basic format: `receiver 'de' sender msg` where **=** is place for the message and **=(** after.
+  * ***def encode_ham(sender, receiver, msg)*** takes the three arguments and formats them to ham stands. After doing that it will then run the new string through the morse encoder from [part 1](https://gitlab.uwe.ac.uk/jo2-holdsworth/iot-worksheet-2-part-1) and returns the output. ![image](src/screenshot14.PNG)
+* ***The ham decoder:***
+  * Ham follows a basic format: `receiver 'de' sender msg` where **=** is place for the message and   **=(** after. We can use this to decode incoming messages.
+  * ***def decode_ham(msg)*** takes one argument of a morse string and returns a python tuple of the **sender receiver** and **message**. Again using the morse decoder from [part 1](https://gitlab.uwe.ac.uk/jo2-holdsworth/iot-worksheet-2-part-1). ![image](src/screenshot15.PNG)
+* ***unittest.py*** unittest is an inbuilt Python library. Its a test runner and is specially design for running tests and debugging. This one contains a few useful tools that we are going to use. It works similarly to the assert function. We've written a few test cases to test things like: Correct, incorrect, invalid inputs for both encode and decode. After running the unittests I found an error. ![image](src/screenshot16.PNG) The command `ret.split("DE")` is used to split the **sender** from the **receiver** however it will keep splitting even after the first DE. Simply adding a limit will solve this problem. ![image](src/screenshot17.PNG) ![image](src/screenshot18.PNG)
+___
+### Task 3: Server echo.
+* *The CSCT cloud server has a port open on 10102 which contains two services, **echo**, sends back the message to the sender and **time**, sends back the time.
+* To communicate with the server we simple need to bring a few things together from previous tasks.
+* ***server.py*** connects to the servers websocket and sends and receives json from the server. It packages up the necessary components, type, client_id, and payload in json to be able to comminate with the protocol on the server. ![image](src/screenshot19.PNG)
+* ***hamradio.py*** Please see **The ham encoder/decoder:** section to see how this works.
+* ***hamserver.py*** This brings the two files above into one file to be able to encode and decode the server messages as it operates using the ham format. ![image](src/screenshot20.PNG).
+* ***unittest.py*** unittest is an inbuilt Python library. Its a test runner and is specially design for running tests and debugging. This one contains a few useful tools that we are going to use. It works similarly to the assert function. We've written a few test cases to test things like: Correct, incorrect, invalid inputs for both encode and decode. Again after testing I found a **FUNDAMENTAL ERROR** I was using two spaces to indicate a separation of works when in fact it should be three. Heres how I went about fixing it. ![image](src/screenshot21.PNG) Here you can see that double spacing has appeared in the result this is unexpected. [part 1](https://gitlab.uwe.ac.uk/jo2-holdsworth/iot-worksheet-2-part-1)'s logic will need to be changed in both the **encode** and **decode** functions to accommodate the change.![image](src/screenshot22.PNG)![image](src/screenshot23.PNG)![image](src/screenshot25.PNG)![image](src/screenshot24.PNG). To be able to test the time function we must first get the time. `datetime` can do that for us. This method of testing is not bullet proof but it does run successfully most of the time on quick connections. ![image](src/screenshot26.PNG)
+## Getting Started
+
+* Running the task files
+  * Task 1: `python3 binaryheap.py`
+  * Task 2: `python3 hamradio.py`
+  * Task 3: `python3 hamserver.py`
+
+### Dependencies
+
+* datetime
+* asyncio
+* unittest
+
+### Installing
+
+* Nothing to install
+
+## Authors
+
+Contributors names and contact info
+
+ex. Jack Holdsworth @ [my website](https://holdsworth.dev)
+
+## Version History
+* 0.4
+  * README
+  * Unittesting
+* 0.3
+  * task 2 done
+  * started task 3
+* 0.2
+  * most of task 2 done
+  * README made
+* 0.1
+  * init.
 
 ## License
-For open source projects, say how it is licensed.
-
-## Project status
-If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
+This project is licensed under the GPL License - see the LICENSE.md file for details
diff --git a/binaryheap.py b/binaryheap.py
new file mode 100644
index 0000000000000000000000000000000000000000..1eb3b6e44d2d9fe17455a660283e322c9e5a6620
--- /dev/null
+++ b/binaryheap.py
@@ -0,0 +1,31 @@
+def decode_bt(string):
+    # a binary heap decode function without the use of OOP
+
+    # the heap (tree)
+    tree = " ETIANMSURWDKGOHVF*L*PJBXCYZQ**54*3*¿?2&*+****16=/***(*7***8*90*************_****\"**.********'**-********;!*)***¡*,****:****************$***********************************************************************************************************************"
+
+    output = ""
+    parent = 1 # base value of tree +1 for offset by ' ' character
+    for i in range(len(string)):
+        if i < len(string) - 1 : # head and body of the input string
+            if string[i] == " ": # end of letter
+                output += tree[parent - 1] # at the end of the letter we grab the current node (-1 offset) and append to output
+                parent = 1 # reset tree
+            if string[i] == ".": # go to the left child
+                parent = 2 * parent # left child's position
+            elif string[i] == "-": # go to the right child
+                parent = 2 * parent + 1 # right child's position
+        else: # tail of the input string
+            if string[i] == ".": # go to the left child
+                parent = 2 * parent # left child's position
+            if string[i] == "-": # go to the right child
+                parent = 2 * parent + 1 # right child's position
+            output += tree[parent - 1] # at the end of the letter we grab the current node (-1 offset) and append to output
+            parent = 1 # reset tree
+    return output.replace("  ", " ")
+
+if __name__ == '__main__':
+    print("=== TASK 1 by Jack H ===")
+    print(decode_bt(".... . .-.. .-.. --- -.-.-- --..--   - .... .. ...   .. ...   - .- ... -.-   .----"))
+    print(decode_bt("..   -.-. .- -.   -.. ---   ... .--. . -.-. .. .- .-..   -.-. .... .- .-. .- -.-. - . .-. ...   .-.. .. -.- .   .-..."))
+    print("========================")
\ No newline at end of file
diff --git a/convert.py b/convert.py
new file mode 100644
index 0000000000000000000000000000000000000000..6542bc0432fe961fb2925b1c2e1d70f0a1b79755
--- /dev/null
+++ b/convert.py
@@ -0,0 +1,6 @@
+tree = "-ETIANMSURWDKGOHVF*L*PJBXCYZQ**54*3*¿?2&*+****16=/***(*7***8*90*************_****\"**.********'**-********;!*)***¡*,****:****************$***********************************************************************************************************************"
+output = ""
+for item in tree:
+    output +=  "\"" + item + "\"" + ","
+
+print(output)
\ No newline at end of file
diff --git a/hamradio.py b/hamradio.py
new file mode 100644
index 0000000000000000000000000000000000000000..133cf0c659ccffa5e971dcd2b1759d029f7b3a2f
--- /dev/null
+++ b/hamradio.py
@@ -0,0 +1,23 @@
+# encode_ham(sender: str, receiver: str, msg:str) -> str
+import morse
+
+
+def encode_ham(sender, receiver, msg):
+    # ham radio format + encoder
+    output = receiver + "de" + sender + "=" + msg + "=("
+    return morse.encode(output)
+
+def decode_ham(morseStr):
+    # hame radio decoder to python tuple
+    ret = morse.decode(morseStr) # decode into string
+    #split into variables
+    sender = ret.split("DE",1)
+    receiver = sender[1].split("=")
+    msg = receiver[1].split("=(")
+    return (sender[0],receiver[0],msg[0]) #tuple
+
+if __name__ == '__main__':
+    print("=== Task 2 by Jack H ===")
+    print(encode_ham('JACK','IOT','YOU ARE THE BEST MODULE'))
+    print(decode_ham(encode_ham('JACK','IOT','YOU ARE THE BEST MODULE')))
+    print("========================")
\ No newline at end of file
diff --git a/hamserver.py b/hamserver.py
new file mode 100644
index 0000000000000000000000000000000000000000..6b4118cbbae36d1b3d95bbd2f696042286461c82
--- /dev/null
+++ b/hamserver.py
@@ -0,0 +1,18 @@
+import server
+import asyncio
+import hamradio
+
+
+def send_echo(sender,msg):
+    # server echos message
+    return hamradio.decode_ham(asyncio.run(server.main(hamradio.encode_ham(sender,"echo",msg))))
+
+def send_time(sender):
+    # server reply's with time
+    return hamradio.decode_ham(asyncio.run(server.main(hamradio.encode_ham(sender,"time","hello world"))))
+
+if __name__ == '__main__':
+    print("=== Task 3 by Jack H ===")
+    print(send_echo('Tutor','YOU ARE THE BEST TUTOR'))
+    print(send_time('IOT'))
+    print("========================")
\ No newline at end of file
diff --git a/morse.py b/morse.py
new file mode 100644
index 0000000000000000000000000000000000000000..bcc2529dedb1b2d22bd97b0ca60670782bc974f2
--- /dev/null
+++ b/morse.py
@@ -0,0 +1,145 @@
+class node:
+    def __init__(self, value, left=None, right=None):
+        self.value = value # Contains itself value
+        self.leftChildNode = left # a node object for the left default is None
+        self.rightChildNode = right # a node object to the right default 
+        
+
+    def setLeftChildNode(self,nodes):
+        # setter for left child
+        self.leftChildNode = nodes
+
+    def setRightChildNode(self,nodes):
+        # setter for right child
+        self.rightChildNode = nodes
+
+    def hasLeftChildNode(self):
+        # getter for left child
+        if self.leftChildNode != None:
+            return True
+        else:
+            return False
+
+    def hasRightChildNode(self):
+        # getter for right child
+        if self.rightChildNode != None:
+            return True
+        else:
+            return False
+    
+    def printNode(self, level=1,direction="S"):
+        # prints child nodes with directions
+        
+        # sets spaces for node level. E.I. a child with 3 parents will have 3 spaces
+        for x in range(level):
+            print(" ", end = '')
+        print(direction + " - " + str(self.value)) # Either (L)eft child or (R)ight child
+        
+        # If has child then call recursion
+        if self.hasLeftChildNode() == True:  
+            self.leftChildNode.printNode((level+1),"L")
+        if self.hasRightChildNode() == True:
+            self.rightChildNode.printNode((level+1), "R")
+
+    def words(self,values):
+        # a method to splits morse words into an array of morse words and decode them.
+        
+        if values: # stops recursion when NoneType is returned.
+            x = values.split(" ") # split string into array of words
+            output = []
+            for y in x: # for every word
+                if y != "": # call decode for each  morse word if string isn't empty
+                    output.append(self.decode(y))
+                else:
+                    output.append(" ") # add a space back in output if empty
+            return "".join(output).replace("  ", " ")
+
+    def decode(self,values):
+        # a method to decode morse suing recursion 
+        if values: # if not end of string
+            
+            # if . go to left child or is - go to right child and call recursion
+            if values[0] == ".": 
+                return self.leftChildNode.decode(values[1:])
+            elif values[0] == "-":
+                return self.rightChildNode.decode(values[1:])
+            else:
+                print("ERROR") # error checking
+        else:
+            return self.value # return the value of the object at end of string.
+        
+
+    def encode(self,word):
+        # a method to handle the encoder
+        word = word.upper() # cleans input
+        output = [] # output string
+        for letter in word: # for letters in words
+            if letter == " ": # spaces for words
+                output.append("  ")
+                continue
+            ret = self.encoder(letter) # calls the encoder function
+            if ret != "": # in not empty string for error check
+                output.append(ret) # append letter
+                output.append(" ") # append space
+        return "".join(output[:len(output)-1])
+        
+    def encoder(self,letter, string = ""):
+        # a method to search the binary tree 
+        if letter == self.value: # check is value has been found
+            return string 
+        else: # if not found 
+            if self.leftChildNode != None: # if left child exists
+                if self.leftChildNode.encoder(letter,(string + "-")) != "": # recursively check child's branch 
+                    return self.leftChildNode.encoder(letter,(string + ".")) # append '.' to the string variable if found (this applies to each parent of the child's branch making the -.-.-.-. string)
+            if self.rightChildNode != None: #if right child exists
+                if self.rightChildNode.encoder(letter,(string + ".")) != "": # recursively check child's branch 
+                    return self.rightChildNode.encoder(letter,(string + "-")) # append '-' to the string variable if found (this applies to each parent of the child's branch making the -.-.-.-. string)
+            return "" # if not found in branch
+        
+def initTree():
+    # Breadth-first array of strings 
+    # alphabet = ["E","T","I","A","N","M","S","U","R","W","D","K","G","O","H","V","F","*","L","*","P","J","B","X","C","Y","Z","Q","*","*"]
+    alphabet = ["E","T","I","A","N","M","S","U","R","W","D","K","G","O","H","V","F","*","L","*","P","J","B","X","C","Y","Z","Q","*","*","5",
+                "4","*","3","*","¿","?","2","&","*","+","*","*","*","*","1","6","=","/","*","*","*","(","*","7","*","*","*","8","*","9","0",
+                "*","*","*","*","*","*","*","*","*","*","*","*","*","_","*","*","*","*","\"","*","*",".","*","*","*","*","*","*","*","*","'",
+                "*","*","-","*","*","*","*","*","*","*","*",";","!","*",")","*","*","*","¡","*",",","*","*","*","*",":","*","*","*","*","*",
+                "*","*","*","*","*","*","*","*","*","*","*","$","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*",
+                "*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*",
+                "*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*",
+                "*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*",
+                "*","*","*","*","*","*","*"]
+    
+    # the stack
+    queue = []
+
+    #starting parent object  
+    start = node("start")
+
+    # add to stack
+    queue.append(start)
+    count = 0
+
+    # append add the children in the binary tree.
+    while count < len(alphabet)-1: # for each string in array
+        parent = queue.pop(0) # grab the current parent and pop as not needed again
+        childLeft = node(alphabet[count]) # make class with value from array 
+        parent.setLeftChildNode(childLeft) # add to the left child of parent.
+        queue.append(childLeft) # add new child to parent stack
+        count += 1 # count
+        childRight = node(alphabet[count]) # make class with value from array 
+        parent.setRightChildNode(childRight) # add to the right child of parent.
+        queue.append(childRight) # add new child to parent stack
+        count += 1 # count
+
+    return start # return parent node
+
+def encode(value):
+    # the encoder
+    tree = initTree()
+    return tree.encode(value)
+    
+
+def decode(value):
+    # the decoder
+    tree = initTree()
+    return tree.words(value)
\ No newline at end of file
diff --git a/runtime.py b/runtime.py
new file mode 100644
index 0000000000000000000000000000000000000000..b66993e38af4f13262c12d5a02976d99d54ec2c5
--- /dev/null
+++ b/runtime.py
@@ -0,0 +1,6 @@
+import time
+import binaryheap as morse
+start = time.time()
+morse.decode_bt('.. --- -  .. ...  - .... .  -... . ... -')
+end = time.time()
+print(f"morse(heap): {end-start}")
\ No newline at end of file
diff --git a/server.py b/server.py
new file mode 100644
index 0000000000000000000000000000000000000000..4417835a274f6eb93434b306145b0191e1afbd1a
--- /dev/null
+++ b/server.py
@@ -0,0 +1,47 @@
+import asyncio
+import websockets
+import json
+import time
+
+
+async def main(str):
+    uri = "ws://localhost:10102"
+    async with websockets.connect(uri) as websocket:
+        # After joining server will send client unique id.
+        message = json.loads(await websocket.recv())
+        print(message)
+        # Get the client_id from the join message
+        if message['type'] == 'join_evt':
+            client_id = message['client_id']
+            # Send a ping to the server
+            await send_message(websocket, str, client_id)
+            # Wait for the 'ping' response from the server
+            response = await recv_message(websocket)
+            print("The Server Sent Back:")
+            print(response)
+
+        else:
+            # If first message is not the join message exit
+            print("Did not receive a correct join message")
+            return 0
+        return response
+
+async def send_message(websocket, message, client_id):
+    outward_message = {
+    'type' : 'morse_evt',
+    'client_id': client_id,
+    'payload': message
+    }
+    await websocket.send(json.dumps(outward_message))
+
+async def recv_message(websocket):
+    message = json.loads(await websocket.recv())
+    return message['payload']
+
+
+if __name__ == "__main__":
+    print("Echo client")
+
+    while 1:
+        time.sleep(1)
+        asyncio.run(main('. -.-. .... --- -.. . .--- .- -.-. -.- -...- .. --- -   .. ...   - .... .   -... . ... -   -- --- -.. ..- .-.. . -...- -.--.'))
diff --git a/src/screenshot1.PNG b/src/screenshot1.PNG
new file mode 100644
index 0000000000000000000000000000000000000000..7d912a58f7f2b04567312d5b883434837b37c37a
Binary files /dev/null and b/src/screenshot1.PNG differ
diff --git a/src/screenshot10.PNG b/src/screenshot10.PNG
new file mode 100644
index 0000000000000000000000000000000000000000..57a5fc41d308a14c35beb6a78e47f9b7c310b6ce
Binary files /dev/null and b/src/screenshot10.PNG differ
diff --git a/src/screenshot11.PNG b/src/screenshot11.PNG
new file mode 100644
index 0000000000000000000000000000000000000000..87e4cb2768ef8d504f498f787537d3250adf1f89
Binary files /dev/null and b/src/screenshot11.PNG differ
diff --git a/src/screenshot12.PNG b/src/screenshot12.PNG
new file mode 100644
index 0000000000000000000000000000000000000000..d787258745dfc47a1f96e7f87f91f83837011123
Binary files /dev/null and b/src/screenshot12.PNG differ
diff --git a/src/screenshot13.PNG b/src/screenshot13.PNG
new file mode 100644
index 0000000000000000000000000000000000000000..bf2484be0ee1ed5b312a6b849edaffa17fd5101b
Binary files /dev/null and b/src/screenshot13.PNG differ
diff --git a/src/screenshot14.PNG b/src/screenshot14.PNG
new file mode 100644
index 0000000000000000000000000000000000000000..67de04f8d7432813112a9f2bda2d2f70ef846a14
Binary files /dev/null and b/src/screenshot14.PNG differ
diff --git a/src/screenshot15.PNG b/src/screenshot15.PNG
new file mode 100644
index 0000000000000000000000000000000000000000..03e45bf48929d5a9f0915acf2002168f1f047025
Binary files /dev/null and b/src/screenshot15.PNG differ
diff --git a/src/screenshot16.PNG b/src/screenshot16.PNG
new file mode 100644
index 0000000000000000000000000000000000000000..5d3fecd772feaa113fbef47d7e073a84a38c9fdc
Binary files /dev/null and b/src/screenshot16.PNG differ
diff --git a/src/screenshot17.PNG b/src/screenshot17.PNG
new file mode 100644
index 0000000000000000000000000000000000000000..5d1f7a69ca3a36bd6b18368d6a673dd18df28cd4
Binary files /dev/null and b/src/screenshot17.PNG differ
diff --git a/src/screenshot18.PNG b/src/screenshot18.PNG
new file mode 100644
index 0000000000000000000000000000000000000000..071f3faf30efaeb6a0c94f314f530f389afb1696
Binary files /dev/null and b/src/screenshot18.PNG differ
diff --git a/src/screenshot19.PNG b/src/screenshot19.PNG
new file mode 100644
index 0000000000000000000000000000000000000000..b482b89a453d1e13f982af00dcd3302a02923b66
Binary files /dev/null and b/src/screenshot19.PNG differ
diff --git a/src/screenshot2.PNG b/src/screenshot2.PNG
new file mode 100644
index 0000000000000000000000000000000000000000..80fa0f6bada66442b9859ac2d7a146c21e51d6eb
Binary files /dev/null and b/src/screenshot2.PNG differ
diff --git a/src/screenshot20.PNG b/src/screenshot20.PNG
new file mode 100644
index 0000000000000000000000000000000000000000..843b5e9a6eb0f6befe671decaf3ff4f3ee38af4a
Binary files /dev/null and b/src/screenshot20.PNG differ
diff --git a/src/screenshot21.PNG b/src/screenshot21.PNG
new file mode 100644
index 0000000000000000000000000000000000000000..e823309bfde9e4c4b89ff8c4aa21879b8be9ab11
Binary files /dev/null and b/src/screenshot21.PNG differ
diff --git a/src/screenshot22.PNG b/src/screenshot22.PNG
new file mode 100644
index 0000000000000000000000000000000000000000..d85d082a40de583cd19c63f045e23b90af7e0fe6
Binary files /dev/null and b/src/screenshot22.PNG differ
diff --git a/src/screenshot23.PNG b/src/screenshot23.PNG
new file mode 100644
index 0000000000000000000000000000000000000000..2ef3237660c4a27a223be5a1abc9b322bd7e9b28
Binary files /dev/null and b/src/screenshot23.PNG differ
diff --git a/src/screenshot24.PNG b/src/screenshot24.PNG
new file mode 100644
index 0000000000000000000000000000000000000000..e17a40dd663b21502ff13af2749d6d1128907db7
Binary files /dev/null and b/src/screenshot24.PNG differ
diff --git a/src/screenshot25.PNG b/src/screenshot25.PNG
new file mode 100644
index 0000000000000000000000000000000000000000..513f308ca44f9b6b6c3fe49f0ac863be1ab36f91
Binary files /dev/null and b/src/screenshot25.PNG differ
diff --git a/src/screenshot26.PNG b/src/screenshot26.PNG
new file mode 100644
index 0000000000000000000000000000000000000000..6ea03d0700e7e23fd3fa210e162892954c079f98
Binary files /dev/null and b/src/screenshot26.PNG differ
diff --git a/src/screenshot3.PNG b/src/screenshot3.PNG
new file mode 100644
index 0000000000000000000000000000000000000000..7c6383592fa9213785682dc136d42f8903e82758
Binary files /dev/null and b/src/screenshot3.PNG differ
diff --git a/src/screenshot4.PNG b/src/screenshot4.PNG
new file mode 100644
index 0000000000000000000000000000000000000000..70ef5a3e90fcbb6d377d42ce9f6b2e75ab7291be
Binary files /dev/null and b/src/screenshot4.PNG differ
diff --git a/src/screenshot5.PNG b/src/screenshot5.PNG
new file mode 100644
index 0000000000000000000000000000000000000000..da961d77c38917bd76ebee552e45126e293c53b9
Binary files /dev/null and b/src/screenshot5.PNG differ
diff --git a/src/screenshot6.PNG b/src/screenshot6.PNG
new file mode 100644
index 0000000000000000000000000000000000000000..cac9d050d7edec5c490e48c8c2e4c41e8bb4da64
Binary files /dev/null and b/src/screenshot6.PNG differ
diff --git a/src/screenshot7.PNG b/src/screenshot7.PNG
new file mode 100644
index 0000000000000000000000000000000000000000..63f9712184806dfbfa1d7e9ac8f404b91d0c443c
Binary files /dev/null and b/src/screenshot7.PNG differ
diff --git a/src/screenshot8.PNG b/src/screenshot8.PNG
new file mode 100644
index 0000000000000000000000000000000000000000..23bd70786359e10fc9dbd8a5dfc4f1e6d3e462c0
Binary files /dev/null and b/src/screenshot8.PNG differ
diff --git a/src/screenshot9.PNG b/src/screenshot9.PNG
new file mode 100644
index 0000000000000000000000000000000000000000..48c7cf0b4ae35aa7b9ad6adccf6a2583b051448e
Binary files /dev/null and b/src/screenshot9.PNG differ
diff --git a/src/uwe.png b/src/uwe.png
new file mode 100644
index 0000000000000000000000000000000000000000..e3c5878ecfa07bf72ea7239a678182a37bcb669e
Binary files /dev/null and b/src/uwe.png differ
diff --git a/unititest.py b/unititest.py
new file mode 100644
index 0000000000000000000000000000000000000000..668af823e31403dfbdf0d8a9e2c759ae8eeb1a3a
--- /dev/null
+++ b/unititest.py
@@ -0,0 +1,73 @@
+import unittest
+import binaryheap
+import hamradio
+import hamserver
+import datetime 
+class TestMorse(unittest.TestCase):
+# task 1
+    # decode_bt tests
+    def test_decode_bt_us(self):
+        self.assertEqual( binaryheap.decode_bt('..- ...'), 'US')
+    def test_decode_bt_hello_again(self):
+        self.assertEqual( binaryheap.decode_bt('.... . .-.. .-.. ---  .- --. .- .. -.'), 'HELLO AGAIN')
+    def test_decode_bt_IOt_IS_ThE_bESt(self):
+        self.assertEqual( binaryheap.decode_bt('.. --- -  .. ...  - .... .  -... . ... -'), 'IOT IS THE BEST')
+    def test_decode_bt_CAPITALS(self):
+        self.assertEqual( binaryheap.decode_bt('-.-. .- .--. .. - .- .-.. ...'), 'CAPITALS')
+    def test_decode_bt_incorrect(self):
+        self.assertEqual( binaryheap.decode_bt('.. -. -.-. --- .-. .-. . -.-. -'), 'CORRECT')
+    def test_decode_bt_numbers(self):
+        self.assertEqual( binaryheap.decode_bt('.. -  -.. --- . ... -. -  -.. ---  -. ..- -- -... . .-. ...'), '123')
+    def test_decode_bt_special_chars(self):
+        self.assertEqual( binaryheap.decode_bt('.. -  -.. --- . ... -. -  -.. ---  ... .--. . -.-. .. .- .-..  -.-. .... .- .-. ...'), '@&%')
+    
+    #  addition tests.
+    def test_decode_bt_question_mark(self):
+        self.assertEqual( binaryheap.decode_bt('..--.'), '?')
+    def test_decode_bt_dollar(self):
+        self.assertEqual( binaryheap.decode_bt('...-..-'), '$')
+    def test_decode_bt_colon(self):
+        self.assertEqual( binaryheap.decode_bt('---...'), ':')
+# task 2
+    # encode
+    def test_encode_ham_1(self):
+        self.assertEqual( hamradio.encode_ham('s','r','message'), '.-. -.. . ... -...- -- . ... ... .- --. . -...- -.--.')
+    def test_encode_ham_2(self):
+        self.assertEqual( hamradio.encode_ham('JACK','IOT','YOU ARE THE BEST MODULE'), '.. --- - -.. . .--- .- -.-. -.- -...- -.-- --- ..-  .- .-. .  - .... .  -... . ... -  -- --- -.. ..- .-.. . -...- -.--.')
+    def test_encode_ham_3(self):
+        self.assertEqual( hamradio.encode_ham('IOT','JACK','you are the best student'), '.--- .- -.-. -.- -.. . .. --- - -...- -.-- --- ..-  .- .-. .  - .... .  -... . ... -  ... - ..- -.. . -. - -...- -.--.')
+    def test_encode_ham_4(self):
+        self.assertEqual( hamradio.encode_ham('syntaxViolation','de','does It work'), '-.. . -.. . ... -.-- -. - .- -..- ...- .. --- .-.. .- - .. --- -. -...- -.. --- . ...  .. -  .-- --- .-. -.- -...- -.--.')
+    def test_encode_ham_5(self):
+        self.assertEqual( hamradio.encode_ham('incorrect','correct','it shouldn\'t work'), '-.-. --- .-. .-. . -.-. - -.. . .. -. -.-. --- .-. .-. . -.-. - -...- .. -  ... .... --- ..- .-.. -.. -. .----. -  .-- --- .-. -.- -...- -.--.')
+    # decode
+    def test_decode_ham_1(self):
+        self.assertEqual( hamradio.decode_ham('.-. -.. . ... -...- -- . ... ... .- --. . -...- -.--.'), ('R','S','MESSAGE'))
+    def test_decode_ham_2(self):
+        self.assertEqual( hamradio.decode_ham('.. --- - -.. . .--- .- -.-. -.- -...- -.-- --- ..-  .- .-. .  - .... .  -... . ... -  -- --- -.. ..- .-.. . -...- -.--.'), ('IOT','JACK','YOU ARE THE BEST MODULE'))
+    def test_decode_ham_3(self):
+        self.assertEqual( hamradio.decode_ham('.--- .- -.-. -.- -.. . .. --- - -...- -.-- --- ..-  .- .-. .  - .... .  -... . ... -  ... - ..- -.. . -. - -...- -.--.'), ('JACK','IOT','YOU ARE THE BEST STUDENT'))
+    def test_decode_ham_4(self):
+        self.assertEqual( hamradio.decode_ham('-.. . -.. . ... -.-- -. - .- -..- ...- .. --- .-.. .- - .. --- -. -...- -.. --- . ...  .. -  .-- --- .-. -.- -...- -.--.'), ('DE','SYNTAXVIOLATION','DOES IT WORK'))
+    def test_decode_ham_5(self):
+        self.assertEqual( hamradio.decode_ham('-.-. --- .-. .-. . -.-. - -.. . .. -. -.-. --- .-. .-. . -.-. - -...- .. -  ... .... --- ..- .-.. -.. -. .----. -  .-- --- .-. -.- -...- -.--.'), ('CORRECT','INCORRECT','IT SHOULDN\'T WORK'))
+ 
+# task 3
+    # echo
+    def test_echo_ham_1(self):
+        self.assertEqual( hamserver.send_echo('s','message'), ('S', 'ECHO', 'MESSAGE'))
+    def test_echo_ham_2(self):
+        self.assertEqual( hamserver.send_echo('Jack','IOT IS THE BEST MODULE'), ('JACK', 'ECHO', 'IOT IS THE BEST MODULE'))
+    def test_echo_ham_3(self):
+        self.assertEqual( hamserver.send_echo('IOT','YOU ARE THE BEST STUDENT'), ('IOT', 'ECHO', 'YOU ARE THE BEST STUDENT'))
+    def test_echo_ham_4(self):
+        self.assertEqual( hamserver.send_echo('student','error'), ('STUDENT', 'ECHO', 'ERRORS'))
+    def test_echo_ham_5(self):
+        self.assertEqual( hamserver.send_echo('hi','its me'), ('ITS ME', 'ECHO', 'HI'))
+    # time
+    def test_echo_ham_1(self):
+        self.assertEqual( hamserver.send_time('Jack'), ('JACK', 'TIME', datetime.datetime.now().strftime("%H:%M:%S")))
+    def test_echo_ham_2(self):
+        self.assertEqual( hamserver.send_time('IOT'), ('IOT', 'TIME', datetime.datetime.now().strftime("%H:%M:%S")))
+if __name__ == '__main__':
+    unittest.main()