Finished script snippet to clear cores
Added formatted version to document
fixed a couple of minor details