Environment Auto Detection - resolves #4