revise codeing method