Added a input generating function