beginning input function