Refactoring
   - Deleted old code wich was commented out.
   - Added a description of what each function does on top of it.