cleaning up bad chars in code, adding some documentation