Added docstrings to all the functions, plus added a copyToSender function