Moved Range struct out of range function