input a end condition, does not function properly