input

fixed a lot of problems with the input functions leading to failure to
run and loops not breaking