functions in Dim2Search simplified and comment added