done almost all the input