Add schemas code, second attempt.

Why am I rewriting your code?