A Theory of Consciousness