Dusted off code. Fixed globalization issue.