Modified typo and better implementation.