readinput is member function