Added auto detection for colour output, and for reading from stdin