Replaced a section of old code