Rearranged docready func