Add schemas code, second attempt.

fixed