updated function signature
cleaned up
windows IO compile fix
more robust IO
fixed wctest