back ported changes into Ashvin's edits