Consciousness is a feedback loop between the mind and the environment