add more codes

add new code as the former one is quite old