Implementing of new function to check for holes (M.Ivanov)