Added IO monad to better facilitate logging