rewrite plan
add aux lib