now working, removing fprintfs