Refactors basic IO and adds printing an integer to output