restore core.py
added templates that breaks the tests
added test