finding the minimum node