better debug output + getenv