Add schemas code, second attempt.

Sorry, I misunderstood. I've fixed this.