fixed osx io.ReadFile issues
reorganized a few things