Refactored Kata potter

- Solved compilation warnings
- Optimized functions, removed unused functions
- Add documentation for the functions