added functionality of function dimension