Rename readline to readstr
Extract readnum function