altered implementation to avoid use of environment variables