fixed some bugs with the read input function and parameters