Updated to use environment variables