Added basic IO loop