added stdin reading