More docs and updates to the code