add david's code
add david code