First version using basic I/O handling