fixed pERR and pOUT accidental indent
added custom exit function that prints exit code