Unit test for substitution
Towards #1
Implemented substitution
Towards #1