Cleared hook from unnecessary outputs. Added comments for code understanding.