Slimmed the code.