Commented & refactored.