Add schemas code, second attempt.

Because you don't like how I've done it.