documented, refactored a bit
documented, refactored a bit