Added substring function.