Added really basic version of substitution