improved variable name
improve readability
add pruning