loops for input