changing fprintf to cerr (stdio isnt included)