updated with stdin input