Changed the isatty library for simplicity.