Changed waiting for input and added read number.