chagned from stdlib to stdio