input parsing method