Converted to use stages.