- more tidying
- system 'cat' replaced by perl code