use readline instead of gets