Improved old code.