doh, was not using correct comparison operator and instead writing files named 0 everywhere
getting closer - need unicode to work