enable res set
minor changes and whitespace