Removed the old distribute function
Improved docstrings and added a comment